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


> 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:

Right. And here's one that generates a 'symbol ... has no section' warning 
when the object file is linked because two _exit symbols are combined. This 
is what the last patch cured.

clash2.c:
void func()
{
  int i = 1;

  if (i == 1)
    goto exit;
  else
    return;

exit:
  ++i;
  return;
}

int main()
{
  func();
  exit();
  return 0;
}

"good" objdump:
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  21)(scl   2) (nx 1) 0x00000000 _func
AUX tagndx 0 ttlsiz 0x2a lnnos 230 next 12
[  6](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000000 .bf
AUX lnno 2 size 0x0 tagndx 0 endndx 14
[  8](sec -1)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _i
[  9](sec  1)(fl 0x00)(ty   0)(scl   6) (nx 0) 0x00000021 _exit
[ 10](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x0000002a .ef
AUX lnno 12 size 0x0 tagndx 0
[ 12](sec  1)(fl 0x00)(ty  24)(scl   2) (nx 1) 0x0000002c _main
AUX tagndx 0 ttlsiz 0x18 lnnos 278 next 18
[ 14](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x0000002c .bf
AUX lnno 16 size 0x0 tagndx 0
[ 16](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000044 .ef
AUX lnno 5 size 0x0 tagndx 0
[ 18](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x50 nreloc 1 nlnno 13
[ 20](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000050 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 22](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000050 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 24](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _exit


"bad" objdump:

clash2.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  21)(scl   2) (nx 1) 0x00000000 _func
AUX tagndx 0 ttlsiz 0x2a lnnos 230 next 11
[  6](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000000 .bf
AUX lnno 2 size 0x0 tagndx 0 endndx 13
[  8](sec -2)(fl 0x00)(ty   4)(scl   1) (nx 0) 0xfffffffc _i
[  9](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x0000002a .ef
AUX lnno 12 size 0x0 tagndx 0
[ 11](sec  1)(fl 0x00)(ty  24)(scl   2) (nx 1) 0x0000002c _main
AUX tagndx 0 ttlsiz 0x18 lnnos 278 next 17
[ 13](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x0000002c .bf
AUX lnno 16 size 0x0 tagndx 0
[ 15](sec  1)(fl 0x00)(ty   0)(scl 101) (nx 1) 0x00000044 .ef
AUX lnno 5 size 0x0 tagndx 0
[ 17](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x50 nreloc 1 nlnno 13
[ 19](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000050 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 21](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000050 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 23](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _exit




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