🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8827

bfd/aoutx.h minor problems for common symbols (GDB 4.7)

#8827
From: Paul Eggert
Date: Sun, 25 Oct 1992 18:03
56 lines
2543 bytes
bfd/aoutx.h (the BFD 0.18 that is distributed with GDB 4.7) has some minor
problems when setting common symbol section and flags.  These problems don't
affect correctness, but make the code hard to follow.  Two
`cache_ptr->symbol.flags = 0' assignments are useless because
cache_ptr->symbol.flags is immediately set to some other value.  Fortran
common symbols are treated first, as a special case, even though there's
nothing special about them and the extra comparison merely slows things down
for other symbols.  Here is a patch.

===================================================================
RCS file: bfd/aoutx.h,v
retrieving revision 4.7
diff -c -r4.7 bfd/aoutx.h
*** bfd/aoutx.h	1992/10/16 19:15:57	4.7
--- bfd/aoutx.h	1992/10/25 07:24:08
***************
*** 1129,1144 ****
        }
      else {
  
- 	if (sym_is_fortrancommon (cache_ptr))
- 	{
- 	  cache_ptr->symbol.flags = 0;
- 	  cache_ptr->symbol.section = &bfd_com_section;
- 	}
- 	else {
- 
- 
- 	  }
- 	  
  	/* In a.out, the value of a symbol is always relative to the 
  	 * start of the file, if this is a data symbol we'll subtract
  	 * the size of the text section to get the section relative
--- 1129,1134 ----
***************
*** 1160,1168 ****
  	    cache_ptr->symbol.value -= obj_bsssec(abfd)->vma;
  	  }
  	else  if (sym_is_undefined (cache_ptr)) {
- 	    cache_ptr->symbol.flags = 0;
  	    cache_ptr->symbol.section = &bfd_und_section;
  	  }
  	else if (sym_is_absolute(cache_ptr))
  	{
  	  cache_ptr->symbol.section = &bfd_abs_section;
--- 1150,1159 ----
  	    cache_ptr->symbol.value -= obj_bsssec(abfd)->vma;
  	  }
  	else  if (sym_is_undefined (cache_ptr)) {
  	    cache_ptr->symbol.section = &bfd_und_section;
  	  }
+ 	else if (sym_is_fortrancommon (cache_ptr))
+ 	  cache_ptr->symbol.section = &bfd_com_section;
  	else if (sym_is_absolute(cache_ptr))
  	{
  	  cache_ptr->symbol.section = &bfd_abs_section;
Technical Details
Message-ID: <9210251803.AA10259@bi.twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bi.TWinsun.COM!eggert

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,311c107ca85ba19a,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-10-25 12:53:30 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bi.TWinsun.COM!eggert
From: eggert@bi.TWinsun.COM (Paul Eggert)
Subject: bfd/aoutx.h minor problems for common symbols (GDB 4.7)
Message-ID: <9210251803.AA10259@bi.twinsun.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 25 Oct 1992 18:03:30 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 57