26 Aug, 2016

2 commits

  • Update the lexer after 4fab91605a6b ("kbuild: genksyms fix for typeof
    handling").

    Signed-off-by: Michal Marek

    Michal Marek
     
  • The tokenizer misses counting an open-parenthesis when parsing a
    non-trivial typeof beginning with an open-parenthesis. This function
    in include/linux/ceph/libceph.h

    static type *lookup_##name(struct rb_root *root,
    typeof(((type *)0)->keyfld) key)

    When instantiated in net/ceph/mon_client.c, causes subsequent symbols
    including an EXPORT_SYMBOL in that file to be lost.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Michal Marek

    Nicholas Piggin
     

20 Apr, 2016

1 commit


09 Dec, 2015

1 commit

  • The reference files use spaces to separate tokens, however, we must
    preserve spaces inside string literals. Currently the only case in the
    tree is struct edac_raw_error_desc in :

    $ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
    $ mv drivers/edac/amd64_edac.{symtypes,symref}
    $ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
    drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversion changed because of changes in struct edac_raw_error_desc

    Signed-off-by: Michal Marek

    Michal Marek
     

20 Aug, 2015

2 commits

  • Rebuild the parser after commit 1c722503fa81 (genksyms: Duplicate
    function pointer type definitions segfault), using bison 2.7.

    Signed-off-by: Michal Marek

    Michal Marek
     
  • I noticed that genksyms will segfault when it sees duplicate function
    pointer type declaration when I placed the same function pointer
    definition in two separate headers in a local branch as an intermediate
    step of some refactoring. This can be reproduced by piping the following
    minimal test case into `genksyms -r /dev/null` or alternatively, putting
    it into a C file attempting a build:

    typedef int (*f)();
    typedef int (*f)();

    Attaching gdb to genksyms to understand this failure is useless without
    changing CFLAGS to emit debuginfo. Once you have debuginfo, you will
    find that the failure is that `char *s` was NULL and the program
    executed `while(*s)`. At which point, further debugging requires
    familiarity with compiler front end / parser development.

    What happens is that flex identifies the first instance of the token "f"
    as IDENT and the yacc parser adds it to the symbol table. On the second
    instance, flex will identify "f" as TYPE, which triggers an error case
    in the yacc parser. Given that TYPE would have been IDENT had it not
    been in the symbol table, the the segmentaion fault could be avoided by
    treating TYPE as IDENT in the affected rule.

    Some might consider placing identical function pointer type declarations
    in different headers to be poor style might consider a failure to be
    beneficial. However, failing through a segmentation fault makes the
    cause non-obvious and can waste the time of anyone who encounters it.

    Signed-off-by: Richard Yao
    Acked-by: Madhuri Yechuri
    Signed-off-by: Michal Marek

    Richard Yao
     

04 Apr, 2014

1 commit

  • 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: Jan Beulich
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     

20 Mar, 2013

1 commit

  • 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: James Hogan
    Signed-off-by: Rusty Russell

    James Hogan
     

03 Mar, 2013

1 commit


08 Jan, 2012

1 commit


11 Oct, 2011

3 commits


25 Jul, 2011

1 commit

  • 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: Jesper Juhl
    Signed-off-by: Michal Marek

    Jesper Juhl
     

10 Jun, 2011

4 commits


17 Mar, 2011

7 commits


25 Nov, 2010

1 commit


02 Feb, 2010

1 commit


12 Dec, 2009

1 commit

  • Despite being unused these should also get a CRC calculated.
    Primarily I view this as a consistency thing. But I also think this is
    one of the reasons why __crc_* need to be weak (which I think should be
    avoided, and hence we should have the goal to eliminate this so that
    failure to calculate a proper CRC for a symbol causes the build to fail).

    Signed-off-by: Jan Beulich
    Cc: Anibal Monsalve Salazar
    Cc: Steven Rostedt
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Michal Marek

    Jan Beulich
     

16 Nov, 2009

1 commit

  • 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: Josh Triplett

    Josh Triplett
     

23 Sep, 2009

1 commit


15 Jan, 2009

1 commit

  • This reverts commit ad7a953c522ceb496611d127e51e278bfe0ff483.

    And commit: ("allow stripping of generated symbols under CONFIG_KALLSYMS_ALL")
    9bb482476c6c9d1ae033306440c51ceac93ea80c

    These stripping patches has caused a set of issues:

    1) People have reported compatibility issues with binutils due to
    lack of support for `--strip-unneeded-symbols' with objcopy 2.15.92.0.2
    Reported by: Wenji
    2) ccache and distcc no longer works as expeced
    Reported by: Ted, Roland, + others
    3) The installed modules increased a lot in size
    Reported by: Ted, Davej + others

    Reported-by: Wenji Huang
    Reported-by: "Theodore Ts'o"
    Reported-by: Dave Jones
    Reported-by: Roland McGrath
    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

20 Dec, 2008

2 commits

  • 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: Jan Beulich
    Signed-off-by: Sam Ravnborg

    Jan Beulich
     
  • 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: Jan Beulich
    Signed-off-by: Sam Ravnborg

    Jan Beulich
     

04 Dec, 2008

2 commits

  • 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: Andreas Gruenbacher
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Andreas Gruenbacher
     
  • 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: Andreas Gruenbacher
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Andreas Gruenbacher
     

01 Aug, 2008

2 commits

  • The extern flag currently is not included in type dump files
    (genksyms --dump-types). Include that flag there for completeness.

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Sam Ravnborg

    Andreas Gruenbacher
     
  • 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: Andreas Gruenbacher
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Andreas Gruenbacher
     

31 Jul, 2008

1 commit

  • gcc 4.3 correctly determines that input() is unused and gives the
    following warning:

    ...
    HOSTCC scripts/genksyms/lex.o
    scripts/genksyms/lex.c:1487: warning: ‘input’ defined but not used
    ...

    Fix it by adding %option noinput to scripts/genksyms/lex.l and
    regeneration of scripts/genksyms/lex.c_shipped.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     

25 Jul, 2008

1 commit

  • Trying to compile the v850 port brings many compile errors, one of them exists
    since at least kernel 2.6.19.

    There also seems to be noone willing to bring this port back into a usable
    state.

    This patch therefore removes the v850 port.

    If anyone ever decides to revive the v850 port the code will still be
    available from older kernels, and it wouldn't be impossible for the port to
    reenter the kernel if it would become actively maintained again.

    Signed-off-by: Adrian Bunk
    Acked-by: Greg Ungerer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

29 Jan, 2008

1 commit

  • The usage does not mention the "-a,--arch" or "-T,--dump-types" options, so
    add them. The calls to getopt() seem to mention options that no longer exist
    (some "k" and "p" thingy) but omits the "h" option which means using '-h'
    actually triggers the error code path, so update those as well.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Sam Ravnborg

    Mike Frysinger