This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.


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

Bug in binutils 2.10 snap not in binutils 2.9.1


Hi guys,
While working on getting weak symbol support to work, I ran into an 
unrelated problem. I should mention it's unrelated because it also 
happens from my unpatched Oct 1 snapshot.

When compiling this sample program:
#include <stdio.h>

int main()
{
  printf("Test to see if this compiles\n");
  return 0;
}

I get this listing from objdump with binutils 2.9.1:

main.o:     file format coff-go32

SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 main.c
File 
[  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  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x38 nreloc 2 nlnno 0
[  6](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000038 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[  8](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000038 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 10](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000020 _main
[ 11](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _printf


Note the number just to the left of .data and .bss.

Now here's the objdump from the Oct 1 binutils 2.10 snapshot:


main1.o:     file format coff-go32

SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 main1.c
File 
[  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  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x38 nreloc 2 nlnno 0
[  6](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[  8](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 10](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000020 _main
[ 11](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _printf


Note that .data and .bss are zero.

When main.c is compiled and linked with 2.9.1, it prints the message. 
When main.c is compiled and linked with the 2.10 snapshot, 
sometimes nothing happens, other times the program crashes. Like I 
said, I'm sure it isn't the changes I made I used the Oct 1 snapshot as 
it without any of my patches.

Mark

-- 
Mark E. snowball3@usa.net
http://members.xoom.com/snowball3/