From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 731FE3858D3C for ; Thu, 2 Mar 2023 08:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 731FE3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1677745232; bh=VJWegeYhvPiOTTCQq/2qsCO6V45dTJNZLlyX9C9Bsig=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=I73ULX0GAPOxLasbTqTayQzjrYIo+l7Nip9UrwGsUBr2HiLRjFUWml5mtHaqnCX0o 7w5pfdPI3XvqrAYDCgePMZYM585gVmgTCp9M+A+xLSM8gez4nuuuvCKAOakPX73wM2 /TN4PgxueAWtbXLcqzZEqdLdJ04Z9OSzt3wWqKMs= Received: from [IPv6:2408:8471:1003:36e3:fcc9:73a2:e263:ac75] (unknown [IPv6:2408:8471:1003:36e3:fcc9:73a2:e263:ac75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id B8548662F7; Thu, 2 Mar 2023 03:20:26 -0500 (EST) Message-ID: <502da978c3a38a5216a0d9abbbe3ebf22f8688e5.camel@xry111.site> Subject: Re: [PATCH] elfedit: add support for editing e_flags From: Xi Ruoyao To: WANG Xuerui , binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , WANG Xuerui Date: Thu, 02 Mar 2023 16:20:20 +0800 In-Reply-To: <20230302080137.3346439-1-i.swmail@xen0n.name> References: <20230302080137.3346439-1-i.swmail@xen0n.name> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2023-03-02 at 16:01 +0800, WANG Xuerui wrote: > I have to pick up the work because I was trying to make AMDGPU DCN work > on LoongArch, but that piece of code requires hard-float support while > the LoongArch Linux kernel is compiled in the soft-float ABI, leading to > link-time failures intermixing the two. IMO we should keep soft-float ABI while enabling the FPU (i. e. -mabi=3Dlp64s -mfpu=3D64). But ouch, this does not work properly with current GCC... -mfpu=3D64 silently enables using FPR to pass arg and return value, w/o even a warning. Not sure about Clang. I remember I've been saying "floating ABI and floating instruction set should be de-coupled" multiple times: "I" in "ABI" stands for "interface" anyway and all the interfaces are just designed for hiding implementation details. But it seems nobody took it seriously. > Since the hard-float code in > question doesn't pass around FP arguments across the boundary between > object files, but rather only internally, it is safe to just edit the > e_flags of the hard-float objects to make their ABI look like LP64S. > Which led to me discovering the previous similar work [1] has stalled... > And that's why a bunch of LoongArch-related folks are on the CC list. >=20 > [1]: https://sourceware.org/pipermail/binutils/2022-April/120413.html >=20 > =C2=A0binutils/doc/binutils.texi=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 13 +++++- > =C2=A0binutils/elfedit.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 52 +++++++++++++++++++- > - > =C2=A0binutils/testsuite/binutils-all/elfedit-7.d | 10 ++++ > =C2=A0binutils/testsuite/binutils-all/elfedit-8.d | 10 ++++ > =C2=A0binutils/testsuite/binutils-all/elfedit.exp |=C2=A0 2 + > =C2=A05 files changed, 83 insertions(+), 4 deletions(-) > =C2=A0create mode 100644 binutils/testsuite/binutils-all/elfedit-7.d > =C2=A0create mode 100644 binutils/testsuite/binutils-all/elfedit-8.d >=20 > diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi > index b1982a95704..a261af48254 100644 > --- a/binutils/doc/binutils.texi > +++ b/binutils/doc/binutils.texi > @@ -5297,10 +5297,12 @@ elfedit [@option{--input-mach=3D}@var{machine}] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [@option{--input-type=3D= }@var{type}] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [@option{--input-osabi= =3D}@var{osabi}] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [@option{--input-abivers= ion=3D}@var{version}] > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [@option{--input-flags=3D}@va= r{flags}] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--output-mach=3D= }@var{machine} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--output-type=3D= }@var{type} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--output-osabi= =3D}@var{osabi} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--output-abivers= ion=3D}@var{version} > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--output-flags=3D}@va= r{flags} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--enable-x86-fea= ture=3D}@var{feature} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @option{--disable-x86-fe= ature=3D}@var{feature} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [@option{-v}|@option{--v= ersion}] > @@ -5325,7 +5327,7 @@ should be updated. > =C2=A0The long and short forms of options, shown here as alternatives, ar= e > =C2=A0equivalent. At least one of the @option{--output-mach}, > =C2=A0@option{--output-type}, @option{--output-osabi}, > -@option{--output-abiversion}, > +@option{--output-abiversion}, @option{--output-flags}, > =C2=A0@option{--enable-x86-feature} and @option{--disable-x86-feature} > =C2=A0options must be given. > =C2=A0 > @@ -5376,6 +5378,15 @@ isn't specified, it will match any ELF > ABIVERSIONs. > =C2=A0Change the ELF ABIVERSION in the ELF header to @var{version}. > =C2=A0@var{version} must be between 0 and 255. > =C2=A0 > +@item --input-flags=3D@var{flags} > +Set the matching input ELF file @var{e_flags} value to @var{flags}. > +@var{flags} must be an unsigned 32-bit integer.=C2=A0 If @option{--input= - > flags} > +isn't specified, it will match any e_flags value. > + > +@item --output-flags=3D@var{flags} > +Change the @var{e_flags} field in the ELF header to @var{flags}. > +@var{version} must be an unsigned 32-bit integer. > + > =C2=A0@item --enable-x86-feature=3D@var{feature} > =C2=A0Set the @var{feature} bit in program property in @var{exec} or > @var{dyn} > =C2=A0ELF files with machine types of @var{i386} or @var{x86-64}.=C2=A0 T= he > diff --git a/binutils/elfedit.c b/binutils/elfedit.c > index 117e67639a0..512e075f16a 100644 > --- a/binutils/elfedit.c > +++ b/binutils/elfedit.c > @@ -68,6 +68,10 @@ enum elfclass > =C2=A0=C2=A0 }; > =C2=A0static enum elfclass input_elf_class =3D ELF_CLASS_UNKNOWN; > =C2=A0static enum elfclass output_elf_class =3D ELF_CLASS_BOTH; > +static int check_elf_flags =3D 0; > +static unsigned long input_elf_flags =3D 0; > +static int write_elf_flags =3D 0; > +static unsigned long output_elf_flags =3D 0; > =C2=A0 > =C2=A0#ifdef HAVE_MMAP > =C2=A0#include > @@ -394,7 +398,16 @@ update_elf_header (const char *file_name, FILE > *file) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > =C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0 > -=C2=A0 /* Update e_machine, e_type and EI_OSABI.=C2=A0 */ > +=C2=A0 /* Skip if e_flags doesn't match. */ > +=C2=A0 if (check_elf_flags && elf_header.e_flags !=3D input_elf_flags) > +=C2=A0=C2=A0=C2=A0 { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 error > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(_("%s: Unmatched e_flags: 0x%= lx is not 0x%lx\n"), > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 file_name, elf_header.e_flags= , input_elf_flags); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > +=C2=A0=C2=A0=C2=A0 } > + > +=C2=A0 /* Update e_machine, e_type, OSABI, ABIVERSION and e_flags.=C2=A0= */ > =C2=A0=C2=A0 switch (class) > =C2=A0=C2=A0=C2=A0=C2=A0 { > =C2=A0=C2=A0=C2=A0=C2=A0 default: > @@ -410,6 +423,8 @@ update_elf_header (const char *file_name, FILE > *file) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ehdr32.e_ident[EI_OSABI] = =3D output_elf_osabi; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (output_elf_abiversion !=3D -1) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ehdr32.e_ident[EI_ABIVERS= ION] =3D output_elf_abiversion; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (write_elf_flags) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0BYTE_PUT (ehdr32.e_flags, outp= ut_elf_flags); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 status =3D fwrite (&ehdr32, sizeof (= ehdr32), 1, file) =3D=3D 1; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > =C2=A0=C2=A0=C2=A0=C2=A0 case ELFCLASS64: > @@ -421,6 +436,8 @@ update_elf_header (const char *file_name, FILE > *file) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ehdr64.e_ident[EI_OSABI] = =3D output_elf_osabi; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (output_elf_abiversion !=3D -1) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ehdr64.e_ident[EI_ABIVERS= ION] =3D output_elf_abiversion; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (write_elf_flags) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0BYTE_PUT (ehdr64.e_flags, outp= ut_elf_flags); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 status =3D fwrite (&ehdr64, sizeof (= ehdr64), 1, file) =3D=3D 1; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > =C2=A0=C2=A0=C2=A0=C2=A0 } > @@ -904,6 +921,8 @@ enum command_line_switch > =C2=A0=C2=A0=C2=A0=C2=A0 OPTION_OUTPUT_OSABI, > =C2=A0=C2=A0=C2=A0=C2=A0 OPTION_INPUT_ABIVERSION, > =C2=A0=C2=A0=C2=A0=C2=A0 OPTION_OUTPUT_ABIVERSION, > +=C2=A0=C2=A0=C2=A0 OPTION_INPUT_FLAGS, > +=C2=A0=C2=A0=C2=A0 OPTION_OUTPUT_FLAGS, > =C2=A0#ifdef HAVE_MMAP > =C2=A0=C2=A0=C2=A0=C2=A0 OPTION_ENABLE_X86_FEATURE, > =C2=A0=C2=A0=C2=A0=C2=A0 OPTION_DISABLE_X86_FEATURE, > @@ -920,6 +939,8 @@ static struct option options[] =3D > =C2=A0=C2=A0 {"output-osabi",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0required_argum= ent, 0, OPTION_OUTPUT_OSABI}, > =C2=A0=C2=A0 {"input-abiversion",=C2=A0required_argument, 0, > OPTION_INPUT_ABIVERSION}, > =C2=A0=C2=A0 {"output-abiversion",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0required_argument, 0, > OPTION_OUTPUT_ABIVERSION}, > +=C2=A0 {"input-flags",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0required_argum= ent, 0, OPTION_INPUT_FLAGS}, > +=C2=A0 {"output-flags",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0required_argument, = 0, OPTION_OUTPUT_FLAGS}, > =C2=A0#ifdef HAVE_MMAP > =C2=A0=C2=A0 {"enable-x86-feature", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0req= uired_argument, 0, > OPTION_ENABLE_X86_FEATURE}, > @@ -958,7 +979,11 @@ usage (FILE *stream, int exit_status) > =C2=A0=C2=A0 --output-osabi [%s]\n\ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Set output OSABI\n\ > =C2=A0=C2=A0 --input-abiversion [0-255]=C2=A0 Set input ABIVERSION\n\ > -=C2=A0 --output-abiversion [0-255] Set output ABIVERSION\n"), > +=C2=A0 --output-abiversion [0-255] Set output ABIVERSION\n\ > +=C2=A0 --input-flags [32-bit unsigned integer]\n\ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 Set input e_flags\n\ > +=C2=A0 --output-flags [32-bit unsigned integer]\n\ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 Set output e_flags\n"), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 osabi, osabi= ); > =C2=A0#ifdef HAVE_MMAP > =C2=A0=C2=A0 fprintf (stream, _("\ > @@ -1062,6 +1087,26 @@ main (int argc, char ** argv) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > =C2=A0 > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case OPTION_INPUT_FLAGS: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 check_elf_flags =3D 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 input_elf_flags =3D str= toul (optarg, &end, 0); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (*end !=3D '\0' || i= nput_elf_flags > 0xffffffff) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= error (_("Invalid e_flags: %s\n"), optarg); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= return 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case OPTION_OUTPUT_FLAGS: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write_elf_flags =3D 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 output_elf_flags =3D st= rtoul (optarg, &end, 0); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (*end !=3D '\0' || o= utput_elf_flags > 0xffffffff) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= error (_("Invalid e_flags: %s\n"), optarg); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= return 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > + > =C2=A0#ifdef HAVE_MMAP > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case OPTION_ENABLE_X86_FE= ATURE: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (elf_x86_featur= e (optarg, 1) < 0) > @@ -1094,7 +1139,8 @@ main (int argc, char ** argv) > =C2=A0#endif > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && output_elf_type= =3D=3D -1 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && output_elf_osab= i =3D=3D -1 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && output_elf_abiversio= n =3D=3D -1)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && output_elf_abiversio= n =3D=3D -1 > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && ! write_elf_flags)) > =C2=A0=C2=A0=C2=A0=C2=A0 usage (stderr, 1); > =C2=A0 > =C2=A0=C2=A0 status =3D 0; > diff --git a/binutils/testsuite/binutils-all/elfedit-7.d > b/binutils/testsuite/binutils-all/elfedit-7.d > new file mode 100644 > index 00000000000..8e5a8b7d019 > --- /dev/null > +++ b/binutils/testsuite/binutils-all/elfedit-7.d > @@ -0,0 +1,10 @@ > +#PROG: elfedit > +#elfedit: --output-flags 0xfedcba98 > +#source: empty.s > +#readelf: -h > +#name: Update ELF header 7 (hexadecimal e_flags value) > +#target: *-*-linux* *-*-gnu* > + > +#... > +=C2=A0 Flags:[ \t]+0xfedcba98.* > +#... > diff --git a/binutils/testsuite/binutils-all/elfedit-8.d > b/binutils/testsuite/binutils-all/elfedit-8.d > new file mode 100644 > index 00000000000..9538f4486b8 > --- /dev/null > +++ b/binutils/testsuite/binutils-all/elfedit-8.d > @@ -0,0 +1,10 @@ > +#PROG: elfedit > +#elfedit: --output-flags 12345678 > +#source: empty.s > +#readelf: -h > +#name: Update ELF header 8 (decimal e_flags value) > +#target: *-*-linux* *-*-gnu* > + > +#... > +=C2=A0 Flags:[ \t]+0xbc614e.* > +#... > diff --git a/binutils/testsuite/binutils-all/elfedit.exp > b/binutils/testsuite/binutils-all/elfedit.exp > index 33f4bb05529..47e94e5a775 100644 > --- a/binutils/testsuite/binutils-all/elfedit.exp > +++ b/binutils/testsuite/binutils-all/elfedit.exp > @@ -26,3 +26,5 @@ run_dump_test "elfedit-3" > =C2=A0run_dump_test "elfedit-4" > =C2=A0run_dump_test "elfedit-5" > =C2=A0run_dump_test "elfedit-6" > +run_dump_test "elfedit-7" > +run_dump_test "elfedit-8" --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University