This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Your patch breaks i386-pe gas


On Wed, 16 Aug 2000, Mark E. wrote:

> > Is there any reason to choose the documented behaviour rather than the
> > historical behaviour?  You mentioned DJGPP, but did you mean DJGPP
> > gas?  That can doubtless be fixed in various ways.  Or did you mean
> > some other tool?
> 
> I meant DJGPP gas. Before the patch under BFD gas, a COFF debug symbol from a 
> struct would be incorrectly merged with a non-struct symbol if the two 
> symbols happened use the same name.

And to add some context back into the discussion, this only happens since
version 2.10 of the DJGPP port of binutils. This was pointed out as a bug
report, originally, which could be boiled down to the following little C
source:

------  cut ---------
struct _d_t {
 unsigned drive;
 unsigned head;
};

extern int *head;

int main(void)
{
 head=0;
 return 0;
}
--------------

which leads to a warning message from 'gas' about the type of symbol
'head' being changed from one type number to another. So it's not just
generaly ceanliness we're talking about, but an actual problem. This may
have been caused by the transition to BFD gas, from the traditional style,
which also was done for DJGPP with version 2.10, if memory serves (Mark?).

These are the
relevant excerpts of the objdump of file created binutils-2.8.1 vs 2.10,
of this source:

2.8.1:
[  2](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 gcc2_compiled.
[  3](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000
___gnu_compiled_c
[  4](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 __d_t
AUX lnno 0 size 0x8 tagndx 0 endndx 10
[  6](sec -1)(fl 0x00)(ty   e)(scl   8) (nx 0) 0x00000000 _drive
[  7](sec -1)(fl 0x00)(ty   e)(scl   8) (nx 0) 0x00000004 _head
[  8](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000008 .eos
AUX lnno 0 size 0x8 tagndx 4

2.10:
[  2](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000 gcc2_compiled.
[  3](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000000
___gnu_compiled_c
[  4](sec -2)(fl 0x00)(ty   8)(scl  10) (nx 1) 0x00000000 __d_t
AUX lnno 0 size 0x8 tagndx 0 endndx 9
[  6](sec -1)(fl 0x00)(ty   e)(scl   8) (nx 0) 0x00000000 _drive
[  7](sec -1)(fl 0x00)(ty   0)(scl 102) (nx 1) 0x00000008 .eos
AUX lnno 0 size 0x8 tagndx 4

Note that the 'head' field of struct _d_t is missing, here.

Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]