public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/96383] New: Full ABI information missing missing from GCC compiled C
@ 2020-07-29 21:20 woodard at redhat dot com
  2020-07-29 21:23 ` [Bug c/96383] " woodard at redhat dot com
                   ` (35 more replies)
  0 siblings, 36 replies; 37+ messages in thread
From: woodard at redhat dot com @ 2020-07-29 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96383
           Summary: Full ABI information missing missing from GCC compiled
                    C
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: woodard at redhat dot com
  Target Milestone: ---

When GCC compiles C and there is a call to an external function the full ABI
information for the function being called doesn't exist in the caller.

For example compiling bzip2 with gcc 10.1.1 this is all that you get for the
function fflush.

 [  93a4]    subprogram           abbrev: 96
             external             (flag_present) yes
             declaration          (flag_present) yes
             linkage_name         (strp) "fflush"
             name                 (strp) "fflush"
             decl_file            (data1) stdio.h (6)
             decl_line            (data1) 218
             decl_column          (data1) 12

However when you compile the same library with clang you get much more
information:

 [  49ec]    subprogram           abbrev: 26
             name                 (strp) "fflush"
             decl_file            (data1) stdio.h (3)
             decl_line            (data1) 218
             prototyped           (flag_present) yes
             type                 (ref4) [  425e]
             declaration          (flag_present) yes
             external             (flag_present) yes
 [  49f7]      formal_parameter     abbrev: 7
               type                 (ref4) [  47c7]

 [  47c7]    pointer_type         abbrev: 3
             type                 (ref4) [  47cc]
 [  47cc]    structure_type       abbrev: 21
             name                 (strp) "_IO_FILE"
             byte_size            (data1) 216
             decl_file            (data1) struct_FILE.h (4)
             decl_line            (data1) 49
 [  47d4]      member               abbrev: 13
               name                 (strp) "_flags"
               type                 (ref4) [  425e]
               decl_file            (data1) struct_FILE.h (4)
               decl_line            (data1) 51
               data_member_location (data1) 0
 [  47e0]      member               abbrev: 13
               name                 (strp) "_IO_read_ptr"
               type                 (ref4) [  4685]
               decl_file            (data1) struct_FILE.h (4)
               decl_line            (data1) 54
               data_member_location (data1) 8
...

This information is useful because it allows you to verify that the library
that the caller is expecting has the same ABI as the function that the callee
is providing.

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2023-07-07  8:59 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 21:20 [Bug c/96383] New: Full ABI information missing missing from GCC compiled C woodard at redhat dot com
2020-07-29 21:23 ` [Bug c/96383] " woodard at redhat dot com
2020-07-29 21:23 ` woodard at redhat dot com
2020-07-30  3:52 ` [Bug debug/96383] " woodard at redhat dot com
2020-07-30  6:14 ` [Bug debug/96383] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-07-30  8:24 ` rguenth at gcc dot gnu.org
2020-07-30  9:01 ` jakub at gcc dot gnu.org
2020-07-30  9:06 ` rguenther at suse dot de
2020-07-30  9:09 ` jakub at gcc dot gnu.org
2020-07-30  9:34 ` rguenth at gcc dot gnu.org
2020-07-30 12:34 ` [Bug debug/96383] [8/9/10/11 Regression] Full ABI information " rguenth at gcc dot gnu.org
2020-07-30 13:29 ` rguenth at gcc dot gnu.org
2020-07-31  8:23 ` ebotcazou at gcc dot gnu.org
2020-07-31  8:28 ` jakub at gcc dot gnu.org
2020-07-31  8:43 ` rguenth at gcc dot gnu.org
2020-07-31  8:49 ` jakub at gcc dot gnu.org
2020-07-31  8:51 ` ebotcazou at gcc dot gnu.org
2020-07-31  8:52 ` rguenther at suse dot de
2020-07-31  9:00 ` jakub at gcc dot gnu.org
2020-07-31  9:10 ` rguenther at suse dot de
2020-07-31  9:15 ` jakub at gcc dot gnu.org
2020-07-31 10:04 ` rguenther at suse dot de
2020-07-31 12:04 ` ebotcazou at gcc dot gnu.org
2020-07-31 12:10 ` jakub at gcc dot gnu.org
2020-07-31 12:23 ` rguenther at suse dot de
2020-07-31 13:19 ` cvs-commit at gcc dot gnu.org
2020-07-31 13:20 ` [Bug debug/96383] [8/9/10 " rguenth at gcc dot gnu.org
2020-07-31 13:20 ` rguenth at gcc dot gnu.org
2020-08-02 18:42 ` slyfox at gcc dot gnu.org
2020-12-02 12:17 ` aoliva at gcc dot gnu.org
2020-12-02 12:27 ` rguenther at suse dot de
2021-04-30  8:07 ` rguenth at gcc dot gnu.org
2021-05-14  9:53 ` [Bug debug/96383] [9/10 " jakub at gcc dot gnu.org
2021-06-01  8:18 ` rguenth at gcc dot gnu.org
2022-05-27  9:43 ` [Bug debug/96383] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07  8:59 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).