Announcement

Collapse
No announcement yet.

GCC Developers Discuss New Option For Recording Compiler Flags / Details In Binaries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Isn't there a bunch of junk ELF-sections that could contain information like this?
    It would probably get stripped, but I'd prefer that. Sometimes you don't want or need build information recorded.

    Edit: They'll probably stick it in a section. So it would be easily removable.
    Last edited by milkylainen; 17 November 2019, 03:31 AM.

    Comment


    • #12
      Originally posted by milkylainen View Post

      Umm. That does mean that FileZilla recorded the compiletime switches in the binaries.
      It could have been stored in a file although I agree that it's trivial to stick it into a binary.
      I have no idea how it is done in FileZilla, but I thought it was pretty cool.

      Comment


      • #13
        Originally posted by uid313 View Post

        I have no idea how it is done in FileZilla, but I thought it was pretty cool.
        Probably an automatically generated config.h + CPP. It's quite simple really.

        Comment


        • #14
          Originally posted by uid313 View Post

          I have no idea how it is done in FileZilla, but I thought it was pretty cool.
          That's generated during configuration. The list of CFLAGS is saved as a string into a .h file and the preprocessor symbol is later used to display said list.

          Any program that cares about that already do it to some extent. Having a "standard" way of doing it might be nice, especially if the data is saved into its own section that can be discarded using strip or objcopy. I like the idea

          Comment


          • #15
            Originally posted by atomsymbol
            The coding style used in https://gcc.gnu.org/ml/gcc-patches/2.../msg00436.html contains:

            Code:
            switch_to_section (sec);
            which is an ancient coding style involving the use of global variables and thus preventing parallelization of the code.
            there are no global variables in quoted code

            Comment


            • #16
              Originally posted by milkylainen View Post
              Isn't there a bunch of junk ELF-sections that could contain information like this?
              It would probably get stripped, but I'd prefer that. Sometimes you don't want or need build information recorded.

              Edit: They'll probably stick it in a section. So it would be easily removable.
              they provide command-line switch for sticking it in a section. don't pass switch if you don't need it

              Comment


              • #17
                Originally posted by Emmanuel Deloget View Post
                Having a "standard" way of doing it might be nice, especially if the data is saved into its own section that can be discarded using strip or objcopy. I like the idea
                again whole point of this exercise is to not being stripped with debug info. it's intended for distros to add this to standard package build flags. people who do not need it would not pass this flag, that's all. but you can strip it with objcopy if you have nothing else to do

                Comment


                • #18
                  Originally posted by atomsymbol
                  The plain textual style of the patch in the cited web page does not allow us to easily/readily jump to the definition of function "switch_to_section" and examine its implementation.
                  that function definition is not part of the patch. so you can't accuse patch author with its implementation. but that function implementation shares many properties with for example printf

                  Comment


                  • #19
                    Originally posted by atomsymbol
                    Today, sending text to a mailing list does not automatically link a function name to the function's implementation. Somewhere in the future, the link will be there.
                    even today you can press ctrl-f in browser
                    Originally posted by atomsymbol


                    The author is most likely fully aware that the function is accessing global state and that there are no mutexes in the function's implementation.
                    so that? it is the only provided function, author shouldn't rewrite gcc just to please you
                    Originally posted by atomsymbol
                    printf is "MT-safe locale" because it is locking the I/O stream.
                    that's because writing from several threads to one file at the same time will make surprising results. and as it happens, compiler produces exactly one assembler file from each translation unit

                    Comment


                    • #20
                      Originally posted by atomsymbol
                      The ideas you have written in you response are random. Randomness in responses in a discussion usually indicates misunderstanding of the topic.
                      lol, your response indicates misunderstanding of my response. i'd even say your posts indicate your complete cluelessness
                      Originally posted by atomsymbol
                      The fact that "compiler [gcc] produces exactly one assembler file from each translation unit" does not invalidate the fact that it is possible to write a C/C++ compiler generating assembly codes of C/C++ functions mostly concurrently/independently (i.e: out of order) and putting the partial results in serial order only when writing them to the external assembler file.
                      first, that imaginary compiler is not written yet (i mean you are posting shit on forums instead of writing it), second, what this function does is exactly "writing them to the external assembler file" so what is your problem again?

                      Comment

                      Working...
                      X