Bug 13056 - gas is broken
Summary: gas is broken
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 19:45 UTC by H.J. Lu
Modified: 2023-01-27 07:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-08-04 19:45:00 UTC
Assembler in CVS as of Thu Aug  4 12:43:04 PDT 2011 is broken
for x86:

[hjl@gnu-6 testsuite]$ ../as-new  --32 -al /export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s
/export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s: Assembler messages:
/export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s: Error: can't make global register symbol `bar1'
/export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s: Error: can't make global register symbol `bar2'
/export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s: Error: can't make global register symbol `bar3'
GAS LISTING /export/gnu/import/git/binutils/gas/testsuite/gas/i386/inval-equ-2.s 			page 1


   1              		.globl  bar1
   2              		.set    bar1,(%eax+1)
   3 ???? A12A0000 		mov bar1,%eax
   3      00
   4              		.set    bar2,(%eax+1)
   5 ???? A12A0000 		mov bar2,%eax
   5      00
   6              		.globl  bar2
   7              		.set    bar3,(%eax+1)
   8 ???? A12A0000 		mov bar3,%eax
****  Error:can't make global register symbol `bar3'
   8      00
../as-new: BFD (GNU Binutils) 2.21.53.20110804 assertion fail /export/gnu/import/git/binutils/bfd/elf.c:6702
../as-new: BFD (GNU Binutils) 2.21.53.20110804 internal error, aborting at /export/gnu/import/git/binutils/bfd/elfcode.h line 225 in bfd_elf32_swap_symbol_out

../as-new: Please report this bug.

[hjl@gnu-6 testsuite]$
Comment 1 H.J. Lu 2011-08-04 19:48:58 UTC
It is caused by

http://sourceware.org/ml/binutils/2011-08/msg00034.html
Comment 2 Sourceware Commits 2011-08-04 20:54:04 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2011-08-04 20:53:59

Modified files:
	gas            : ChangeLog output-file.c write.c 

Log message:
	Call bfd_cache_close_all on error
	
	2011-08-04  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR gas/13056
	* output-file.c (output_file_close): Call bfd_cache_close_all
	on error.
	
	* write.c (write_object_file): Revert the last change.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4560&r2=1.4561
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/output-file.c.diff?cvsroot=src&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/write.c.diff?cvsroot=src&r1=1.143&r2=1.144
Comment 3 H.J. Lu 2011-08-04 21:12:20 UTC
Fixed
Comment 4 Sourceware Commits 2023-01-27 07:02:55 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3e7cde4dca8c63b8091597bd7800f0f71e822395

commit 3e7cde4dca8c63b8091597bd7800f0f71e822395
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Jan 27 12:31:27 2023 +1030

    Call bfd_close_all_done in output_file_close
    
    bfd_cache_close_all is good for closing file descriptors, but doesn't
    do the cleanup of bfd memory as in bfd_close_all_done.
    
            PR 13056
            * output-file.c (output_file_close): Call bfd_close_all_done,
            not bfd_cache_close_all.