This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS objcopy --rename-section fix
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: <binutils at sourceware dot org>
- Date: Mon, 11 Jul 2016 12:32:00 +0100
- Subject: Re: MIPS objcopy --rename-section fix
- Authentication-results: sourceware.org; auth=none
- References: <20160624141235.GG20200@bubble.grove.modra.org>
On Fri, 24 Jun 2016, Alan Modra wrote:
> Some MIPS targets use a named section symbol rather than a symbol with
> no name as is used with most ELF targets. When renaming sections, the
> named section symbol needs to be renamed too.
Indeed, see also:
commit 174fd7f9556183397625dbfa99ef68ecd325c74b
Author: Richard Sandiford <rdsandiford@googlemail.com>
Date: Mon Feb 9 08:04:00 2004 +0000
<https://sourceware.org/ml/binutils/2004-02/msg00072.html>, ("New bfd elf
hook: force naming of local section symbols").
> Rather than fix this bug, I'd originally intended to just correct the
> xfail added recently for update-1.o vs update4.o in update-section.exp,
> using the same set of targets for the localize-hidden-1 mips xfail.
> (What caught my eye was the "tx39-*-*" target string, which is no
> longer correct, and a bunch of
> XPASS: objcopy (compare update-1.o update-4.o)
> for mips*-linux targets.)
What is wrong with `tx39-*-*' specifically? I've had `tx39-elf' included
in my routine testing and I haven't seen any issues beyond those common to
all MIPS/ELF targets using IRIX-style ELF structures.
> I'd extracted that target test into a new function, is_bad_symtab. I
> think that should be generally useful, as demonstrated by improving the
> selection of mips targets for alternate output in readelf.exp.
Thanks for the clean-ups!
> diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
> index 33a0382..bfe2998 100644
> --- a/binutils/testsuite/lib/binutils-common.exp
> +++ b/binutils/testsuite/lib/binutils-common.exp
> @@ -202,6 +202,36 @@ proc supports_gnu_unique {} {
> return 1
> }
>
> +# True for targets that do not sort .symtab as per the ELF standard.
> +# ie. any that have mips_elf32_be_vec, mips_elf32_le_vec,
> +# mips_elf32_n_be_vec or mips_elf32_n_le_vec as the primary bfd target
> +# vector in config.bfd. When syncing with config.bfd, don't forget that
> +# earlier case-matches trump later ones.
> +proc is_bad_symtab {} {
> + if { ![istarget "mips*-*-*"] } {
> + return 0;
> + }
> + if { [istarget "*-*-chorus*"]
> + || [istarget "*-*-irix5*"]
> + || [istarget "*-*-irix6*"]
> + || [istarget "*-*-none"]
> + || [istarget "*-*-rtems*"]
> + || [istarget "*-*-windiss"] } {
> + return 1;
> + }
> + if { [istarget "*-*-elf*"]
> + && ![istarget "*-sde-*"]
> + && ![istarget "*-mti-*"]
> + && ![istarget "*-img-*"] } {
> + return 1;
> + }
> + if { [istarget "*-*-openbsd*"]
> + && ![istarget "mips64*-*-*"] } {
> + return 1;
I think as from:
commit 26eebcf553d70d50be6c7505e80df35651863aa3
Author: Mark Kettenis <kettenis@gnu.org>
Date: Thu Apr 14 16:55:49 2005 +0000
<https://sourceware.org/ml/binutils/2005-04/msg00337.html>, ("Update
OpenBSD/mips64 support") "mips-*-openbsd*" (non-64-bit) is no longer
supported, so the latter conditional is dead AFAICT.
On a related matter I have a linker configuration patch outstanding to
fix "mips64*-*-openbsd*" as -- for a change -- that configuration has
never been completed and I want to have a MIPS test target that defaults
to n64. I'll push it sometime, when I get to it, that is along with a
necessary MIPS test framework robustification I've got sketched, to
address RichardS's concerns he expressed in
<https://sourceware.org/ml/binutils/2012-08/msg00038.html>, among others.
Maciej