https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

--- Comment #48 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> --- Comment #30 from rguenther at suse dot de <rguenther at suse dot de> ---
> On Thu, 9 Nov 2017, ebotcazou at gcc dot gnu.org wrote:
>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968
>> 
>> --- Comment #29 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
>> > It does by removing the SHT_NULL sections.  The patch should work - you 
>> > can double-check - it just doesn't handle the "corner case" of more
>> > than 32000 input sections correctly when rewriting the symbol table.
>> 
>> There is one nit with -g3 on x86-64/Linux:
>> 
>> FAIL: gcc.dg/debug/pr41893-1.c -gdwarf-2 -g3 (test for excess errors)
>> FAIL: gcc.dg/debug/pr41893-1.c -gdwarf-2 -g3 -O (test for excess errors)
>> FAIL: gcc.dg/debug/pr41893-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
>> 
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: /tmp/ccyqoYHFdebugobjtem: no
>> group info for section .debug_macro
>> /tmp/ccyqoYHFdebugobjtem: file not recognized: Bad value
>> collect2: error: ld returned 1 exit status
>> lto-wrapper: fatal error: gcc/xgcc returned 1 exit status
>> compilation terminated.
>> /home/eric/install/gcc/x86_64-suse-linux/bin/ld: error: lto-wrapper failed
>
> Not sure what this is about.  Ah, I guess I need to remap GROUP
> section indices as well (the GROUP SH_TYPE data).

Right: I'm seeing the same on Solaris (during the ld -r stage):

ld: fatal: file cck8G3nbdebugobjtem: group section
[2].group%wm4.0.2f776312c00a6f17758bdd764e58a026: entry 2: invalid section
index: 26
ld: fatal: file cck8G3nbdebugobjtem: section
[2].group%wm4.0.2f776312c00a6f17758bdd764e58a026: SHF_GROUP flag set, but no
corresponding SHT_GROUP section found
ld: fatal: file cck8G3nbdebugobjtem: section
[6].debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026: SHF_GROUP flag set, but
no corresponding SHT_GROUP section found
ld: fatal: file ccqCKrLbdebugobjtem: group section
[2].group%wm4.0.2f776312c00a6f17758bdd764e58a026: entry 2: invalid section
index: 25
ld: fatal: file ccqCKrLbdebugobjtem: section
[2].group%wm4.0.2f776312c00a6f17758bdd764e58a026: SHF_GROUP flag set, but no
corresponding SHT_GROUP section found
ld: fatal: file ccqCKrLbdebugobjtem: section
[6].debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026: SHF_GROUP flag set, but
no corresponding SHT_GROUP section found

The first input object has

elfdump -c:

Section Header[2]:  sh_name: .group%wm4.0.2f776312c00a6f17758bdd764e58a026
    sh_addr:      0               sh_flags:   0
    sh_size:      0xc             sh_type:    [ SHT_GROUP ]
    sh_offset:    0x428           sh_entsize: 0x4 (3 entries)
    sh_link:      29              sh_info:    7
    sh_addralign: 0x4       

elfdump -g:

Group Section:  .group%wm4.0.2f776312c00a6f17758bdd764e58a026
  Signature Symbol: wm4.0.2f776312c00a6f17758bdd764e58a026
  Members:
    index   flags / section
      [0]   [ COMDAT ]
      [1]   .gnu.debuglto_.debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026
      [2]   .debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026

readelf -g:

COMDAT group section [    2] `.group%wm4.0.2f776312c00a6f17758bdd764e58a026'
[wm4.0.2f776312c00a6f17758bdd764e58a026] contains 2 sections:
   [Index]    Name
   [    7]   .gnu.debuglto_.debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026
   [   25]   .debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026

elfdump -c:

Section Header[7]:  sh_name:
.gnu.debuglto_.debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026
    sh_addr:      0               sh_flags:   [ SHF_GROUP ]
    sh_size:      0x2775          sh_type:    [ SHT_PROGBITS ]
    sh_offset:    0x5b4           sh_entsize: 0
    sh_link:      0               sh_info:    0
    sh_addralign: 0x1       

Section Header[25]:  sh_name:
.debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026
    sh_addr:      0               sh_flags:   [ SHF_GROUP ]
    sh_size:      0x2775          sh_type:    [ SHT_PROGBITS ]
    sh_offset:    0x3336          sh_entsize: 0
    sh_link:      0               sh_info:    0
    sh_addralign: 0x1       

After lto-wrapper, the first group member is wrong (hasn't been remapped)
and the second one doesn't even exist any longer:

Group Section:  .group%wm4.0.2f776312c00a6f17758bdd764e58a026
  Signature Symbol: wm4.0.2f776312c00a6f17758bdd764e58a026
  Members:
    index   flags / section
      [0]   [ COMDAT ]
      [1]   .debug_line
      [2]   <invalid section>

cck8G3nbdebugobjtem: [2: .group%wm4.0.2f776312c00a6f17758bdd764e58a026][2]:
invalid section index: 26

COMDAT group section [    2] `.group%wm4.0.2f776312c00a6f17758bdd764e58a026'
[wm4.0.2f776312c00a6f17758bdd764e58a026] contains 2 sections:
   [Index]    Name
   [    7]   .debug_line
readelf: Error: section [   25] in group section [    2] > maximum section [  
12]

Section Header[2]:  sh_name: .group%wm4.0.2f776312c00a6f17758bdd764e58a026
    sh_addr:      0               sh_flags:   0
    sh_size:      0xc             sh_type:    [ SHT_GROUP ]
    sh_offset:    0x630           sh_entsize: 0x4 (3 entries)
    sh_link:      9               sh_info:    7
    sh_addralign: 0x4       

Section Header[6]:  sh_name:
.debug_macro%wm4.0.2f776312c00a6f17758bdd764e58a026
    sh_addr:      0               sh_flags:   [ SHF_GROUP ]
    sh_size:      0x2775          sh_type:    [ SHT_PROGBITS ]
    sh_offset:    0x7bb           sh_entsize: 0
    sh_link:      0               sh_info:    0
    sh_addralign: 0x1       

        Rainer

Reply via email to