Skip to content
Snippets Groups Projects
  1. Apr 04, 2014
    • Jan Beulich's avatar
      genksyms: fix typeof() handling · dc533240
      Jan Beulich authored
      
      Recent increased use of typeof() throughout the tree resulted in a
      number of symbols (25 in a typical distro config of ours) not getting a
      proper CRC calculated for them anymore, due to the parser in genksyms
      not coping with several of these uses (interestingly in the majority of
      [if not all] cases the problem is due to the use of typeof() in code
      preceding a certain export, not in the declaration/definition of the
      exported function/object itself; I wasn't able to find a way to address
      this more general parser shortcoming).
      
      The use of parameter_declaration is a little more relaxed than would be
      ideal (permitting not just a bare type specification, but also one with
      identifier), but since the same code is being passed through an actual
      compiler, there's no apparent risk of allowing through any broken code.
      
      Otoh using parameter_declaration instead of the ad hoc
      "decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to
      be handled rather than just plain ones and pointers to plain ones.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dc533240
  2. Mar 20, 2013
    • James Hogan's avatar
      genksyms: pass symbol-prefix instead of arch · d70f82ac
      James Hogan authored
      
      Pass symbol-prefix to genksyms instead of arch, so that the decision
      what symbol prefix to use is kept in one place.
      
      Basically genksyms used to take a -a $ARCH argument and it used that to
      determine whether to add an underscore symbol prefix. It's now changed
      to take a -s $SYMBOL_PREFIX argument so that the caller decides whether
      a symbol prefix is required. The build system then uses
      CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX to determine whether to pass the
      argument.
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      d70f82ac
  3. Mar 02, 2013
  4. Jan 08, 2012
  5. Oct 11, 2011
  6. Jul 25, 2011
    • Jesper Juhl's avatar
      genksyms: Use same type in loop comparison · 1ae14703
      Jesper Juhl authored
      
      The ARRAY_SIZE macro in scripts/genksyms/genksyms.c returns a value of
      type size_t. That value is being compared to a variable of type int in
      a loop in read_node(). Change the int variable to size_t type as well,
      so we don't do signed vs unsigned type comparisons with all the
      potential promotion/sign extension trouble that can cause (also
      silences compiler warnings at high levels of warnings).
      
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      1ae14703
  7. Jun 09, 2011
  8. Mar 17, 2011
  9. Nov 25, 2010
  10. Feb 02, 2010
  11. Dec 12, 2009
  12. Nov 16, 2009
    • Josh Triplett's avatar
      genksyms: Mark is_reserved_word static · ed9df091
      Josh Triplett authored
      
      The genksyms keyword gperf hash provides a function is_reserved_word.
      genksyms #includes the resulting generated file keywords.c, so the
      function gets used only in the same source file that defines it.  Mark
      is_reserved_word static, and regenerate the corresponding generated
      file.
      
      Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
      ed9df091
  13. Sep 23, 2009
  14. Jan 14, 2009
  15. Dec 19, 2008
    • Jan Beulich's avatar
      allow stripping of generated symbols under CONFIG_KALLSYMS_ALL · 9bb48247
      Jan Beulich authored
      
      Building upon parts of the module stripping patch, this patch
      introduces similar stripping for vmlinux when CONFIG_KALLSYMS_ALL=y.
      Using CONFIG_KALLSYMS_STRIP_GENERATED reduces the overhead of
      CONFIG_KALLSYMS_ALL from 245k/310k to 65k/80k for the (i386/x86-64)
      kernels I tested with.
      
      The patch also does away with the need to special case the kallsyms-
      internal symbols by making them available even in the first linking
      stage.
      
      While it is a generated file, the patch includes the changes to
      scripts/genksyms/keywords.c_shipped, as I'm unsure what the procedure
      here is.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      9bb48247
    • Jan Beulich's avatar
      kbuild: strip generated symbols from *.ko · ad7a953c
      Jan Beulich authored
      
      This patch changes the way __crc_ symbols are being resolved from
      using ld to do so to using the assembler, thus allowing these symbols
      to be marked local (the linker creates then as global ones) and hence
      allow stripping (for modules) or ignoring (for vmlinux) them. While at
      this, also strip other generated symbols during module installation.
      
      One potentially debatable point is the handling of the flags passeed
      to gcc when translating the intermediate assembly file into an object:
      passing $(c_flags) unchanged doesn't work as gcc passes --gdwarf2 to
      gas whenever is sees any -g* option, even for -g0, and despite the
      fact that the compiler would have already produced all necessary debug
      info in the C->assembly translation phase. I took the approach of just
      filtering out all -g* options, but an alternative to such negative
      filtering might be to have a positive filter which might, in the ideal
      case allow just all the -Wa,* options to pass through.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      ad7a953c
  16. Dec 03, 2008
    • Andreas Gruenbacher's avatar
      genksyms: allow to ignore symbol checksum changes · 5dae9a55
      Andreas Gruenbacher authored
      
      This adds an "override" keyword for use in *.symvers / *.symref files.
      When a symbol is overridden, the symbol's old definition will be used for
      computing checksums instead of the new one, preserving the previous
      checksum.  (Genksyms will still warn about the change.)
      
      This is meant to allow distributions to hide minor actual as well as fake
      ABI changes.  (For example, when extra type information becomes available
      because additional headers are included, this may change checksums even
      though none of the types used have actully changed.)
      
      This approach also allows to get rid of "#ifdef __GENKSYMS__" hacks in the
      code, which are currently used in some vendor kernels to work around
      checksum changes.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      5dae9a55
    • Andreas Gruenbacher's avatar
      genksyms: track symbol checksum changes · 64e6c1e1
      Andreas Gruenbacher authored
      
      Sometimes it is preferable to avoid changes of exported symbol checksums
      (to avoid breaking externally provided modules).  When a checksum change
      occurs, it can be hard to figure out what caused this change: underlying
      types may have changed, or additional type information may simply have
      become available at the point where a symbol is exported.
      
      Add a new --reference option to genksyms which allows it to report why
      checksums change, based on the type information dumps it creates with the
      --dump-types flag.  Genksyms will read in such a dump from a previous run,
      and report which symbols have changed (and why).
      
      The behavior can be controlled for an entire build as follows: If
      KBUILD_SYMTYPES is set, genksyms uses --dump-types to produce *.symtypes
      dump files.  If any *.symref files exist, those will be used as the
      reference to check against.  If KBUILD_PRESERVE is set, checksum changes
      will fail the build.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      64e6c1e1
  17. Jul 31, 2008
    • Andreas Gruenbacher's avatar
      kbuild: genksyms: Include extern information in dumps · 3b40d381
      Andreas Gruenbacher authored
      
      The extern flag currently is not included in type dump files
      (genksyms --dump-types). Include that flag there for completeness.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      3b40d381
    • Andreas Gruenbacher's avatar
      kbuild: genksyms parser: fix the __attribute__ rule · 94aa3d71
      Andreas Gruenbacher authored
      
      We are having two kinds of problems with genksyms today: fake checksum
      changes without actual ABI changes, and changes which we would rather like
      to ignore (such as an additional field at the end of a structure that
      modules are not supposed to touch, for example).
      
      I have thought about ways to improve genksyms and compute checksums
      differently to avoid those problems, but in the end I don't see a
      fundamentally better way.  So here are some genksyms patches for at least
      making the checksums more easily manageable, if we cannot fully fix them.
      
      In addition to the bugfixes (the first two patches), this allows genksyms
      to track checksum changes and report why a checksum changed (third patch),
      and to selectively ignore changes (fourth patch).
      
      This patch:
      
      Gcc __attribute__ definitions may occur repeatedly, e.g.,
      
      	static int foo __attribute__((__used__))
      		       __attribute__((aligned (16)));
      
      The genksyms parser does not understand this, and generates a syntax error.
      Fix this case.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      94aa3d71
  18. Jul 30, 2008
  19. Jul 24, 2008
  20. Jan 28, 2008
  21. Oct 12, 2007
    • Sam Ravnborg's avatar
      kbuild: apply genksyms changes · 70f75246
      Sam Ravnborg authored
      
      This patch updates the _shipped files for genksyms.
      See previous patch for actual functional changes.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      70f75246
    • Sam Ravnborg's avatar
      kbuild: __extension__ support in genksyms (fix unknown CRC warning) · 3550a516
      Sam Ravnborg authored
      
      Recently the __extension__ keyword has been introduced in the kernel.
      Teach genksyms about this keyword so it can generate correct CRC for
      exported symbols that uses a symbol marked __extension__.
      For now only the typedef variant:
      
      	__extension__ typedef ...
      
      is supported.
      Later we may add more variants as needed.
      
      This patch contains the actual source file changes. The
      following patch will hold modifications to the generated
      files (*_shipped) and only after the second patch the fix
      has effect.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      3550a516
    • Sam Ravnborg's avatar
      kbuild: fix genksyms Makefile · a3a6261a
      Sam Ravnborg authored
      
      When enabling GENERATE_PARSER the genksyms Makefile
      failed to create _shipped version of generated files.
      
      Modifying keywords.gperf failed to cause a rebuild
      of genksyms.
      Fixed by specifying keywowrds .c as explicit prerequisite
      of the lexer.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      a3a6261a
  22. May 07, 2007
  23. Jun 24, 2006
    • Sam Ravnborg's avatar
      kbuild: replace abort() with exit(1) · 6803dc0e
      Sam Ravnborg authored
      
      We have had no use of the coredump file for a long time.
      So just exit(1) and avoid coredumping.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      6803dc0e
    • Andreas Gruenbacher's avatar
      kbuild: support for %.symtypes files · 15fde675
      Andreas Gruenbacher authored
      
      Here is a patch that adds a new -T option to genksyms for generating dumps of
      the type definition that makes up the symbol version hashes. This allows to
      trace modversion changes back to what caused them. The dump format is the
      name of the type defined, followed by its definition (which is almost C):
      
        s#list_head struct list_head { s#list_head * next , * prev ; }
      
      The s#, u#, e#, and t# prefixes stand for struct, union, enum, and typedef.
      The exported symbols do not define types, and thus do not have an x# prefix:
      
        nfs4_acl_get_whotype int nfs4_acl_get_whotype ( char * , t#u32 )
      
      The symbol type defintion of a single file can be generated with:
      
        make fs/jbd/journal.symtypes
      
      If KBUILD_SYMTYPES is defined, all the *.symtypes of all object files that
      export symbols are generated.
      
      The single *.symtypes files can be combined into a single file after a kernel
      build with a script like the following:
      
      for f in $(find -name '*.symtypes' | sort); do
          f=${f#./}
          echo "/* ${f%.symtypes}.o */"
          cat $f
          echo
      done \
      | sed -e '\:UNKNOWN:d' \
            -e 's:[,;] }:}:g' \
            -e 's:\([[({]\) :\1:g' \
            -e 's: \([])},;]\):\1:g' \
            -e 's: $::' \
            $f \
      | awk '
      /^.#/   { if (defined[$1] == $0) {
                  print $1
                  next
                }
                defined[$1] = $0
              }
              { print }
      '
      
      When the kernel ABI changes, diffing individual *.symtype files, or the
      combined files, against each other will show which symbol changes caused the
      ABI changes. This can save a tremendous amount of time.
      
      Dump the types that make up modversions
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      15fde675
Loading