[Bug lto/75194] New: -flto loses .debug_macro section

jim at jtan dot com gcc-bugzilla@gcc.gnu.org
Fri Aug 12 19:14:00 GMT 2016


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

            Bug ID: 75194
           Summary: -flto loses .debug_macro section
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jim at jtan dot com
  Target Milestone: ---

With -flto, I can't get "info macros" to work in GDB.  The .debug_macros
section seems to be lost:

$ cat test.c
#define HELLO "hello"
int main() {}
$ gcc -Wall -Wextra -o test1 test.c -ggdb3
$ gcc -Wall -Wextra -o test2 test.c -ggdb3 -flto
$ readelf -WS test1 > 1
$ readelf -WS test2 > 2
$ diff -u 1 2
--- 1   2016-08-12 15:10:04.153446089 -0400
+++ 2   2016-08-12 15:10:07.393523823 -0400
@@ -1,4 +1,4 @@
-There are 37 section headers, starting at offset 0x3398:
+There are 36 section headers, starting at offset 0x1460:

 Section Headers:
   [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
@@ -31,14 +31,13 @@
   [26] .bss              NOBITS          0000000000600890 000890 000008 00  WA
 0   0  1
   [27] .comment          PROGBITS        0000000000000000 000890 000025 01  MS
 0   0  1
   [28] .debug_aranges    PROGBITS        0000000000000000 0008b5 000030 00    
 0   0  1
-  [29] .debug_info       PROGBITS        0000000000000000 0008e5 000056 00    
 0   0  1
-  [30] .debug_abbrev     PROGBITS        0000000000000000 00093b 00003a 00    
 0   0  1
-  [31] .debug_line       PROGBITS        0000000000000000 000975 000057 00    
 0   0  1
-  [32] .debug_str        PROGBITS        0000000000000000 0009cc 0019b8 01  MS
 0   0  1
-  [33] .debug_macro      PROGBITS        0000000000000000 002384 0005f2 00    
 0   0  1
-  [34] .shstrtab         STRTAB          0000000000000000 003239 000159 00    
 0   0  1
-  [35] .symtab           SYMTAB          0000000000000000 002978 0006c0 18    
36  53  8
-  [36] .strtab           STRTAB          0000000000000000 003038 000201 00    
 0   0  1
+  [29] .debug_info       PROGBITS        0000000000000000 0008e5 000052 00    
 0   0  1
+  [30] .debug_abbrev     PROGBITS        0000000000000000 000937 000037 00    
 0   0  1
+  [31] .debug_line       PROGBITS        0000000000000000 00096e 000039 00    
 0   0  1
+  [32] .debug_str        PROGBITS        0000000000000000 0009a7 0000e0 01  MS
 0   0  1
+  [33] .shstrtab         STRTAB          0000000000000000 001312 00014c 00    
 0   0  1
+  [34] .symtab           SYMTAB          0000000000000000 000a88 000690 18    
35  51  8
+  [35] .strtab           STRTAB          0000000000000000 001118 0001fa 00    
 0   0  1
 Key to Flags:
   W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
   I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)


More information about the Gcc-bugs mailing list