No description
Find a file
Miguel Ojeda b00c958ceb Compiler Attributes: add support for __copy (gcc >= 9)
commit c0d9782f5b upstream.

From the GCC manual:

  copy
  copy(function)

    The copy attribute applies the set of attributes with which function
    has been declared to the declaration of the function to which
    the attribute is applied. The attribute is designed for libraries
    that define aliases or function resolvers that are expected
    to specify the same set of attributes as their targets. The copy
    attribute can be used with functions, variables, or types. However,
    the kind of symbol to which the attribute is applied (either
    function or variable) must match the kind of symbol to which
    the argument refers. The copy attribute copies only syntactic and
    semantic attributes but not attributes that affect a symbol’s
    linkage or visibility such as alias, visibility, or weak.
    The deprecated attribute is also not copied.

  https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

The upcoming GCC 9 release extends the -Wmissing-attributes warnings
(enabled by -Wall) to C and aliases: it warns when particular function
attributes are missing in the aliases but not in their target, e.g.:

    void __cold f(void) {}
    void __alias("f") g(void);

diagnoses:

    warning: 'g' specifies less restrictive attribute than
    its target 'f': 'cold' [-Wmissing-attributes]

Using __copy(f) we can copy the __cold attribute from f to g:

    void __cold f(void) {}
    void __copy(f) __alias("f") g(void);

This attribute is most useful to deal with situations where an alias
is declared but we don't know the exact attributes the target has.

For instance, in the kernel, the widely used module_init/exit macros
define the init/cleanup_module aliases, but those cannot be marked
always as __init/__exit since some modules do not have their
functions marked as such.

Suggested-by: Martin Sebor <msebor@gcc.gnu.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-09 09:18:19 +02:00
arch KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
block block: sed-opal: fix IOC_OPAL_ENABLE_DISABLE_MBR 2019-05-31 06:47:29 -07:00
certs
crypto crypto: ccm - fix incompatibility between "ccm" and "ccm_base" 2019-05-21 18:50:20 +02:00
Documentation doc: Cope with Sphinx logging deprecations 2019-06-09 09:18:17 +02:00
drivers drm/rockchip: shutdown drm subsystem on shutdown 2019-06-09 09:18:19 +02:00
firmware
fs Revert "lockd: Show pid of lockd for remote locks" 2019-06-09 09:18:18 +02:00
include Compiler Attributes: add support for __copy (gcc >= 9) 2019-06-09 09:18:19 +02:00
init init: initialize jump labels before command line option parsing 2019-05-16 19:42:23 +02:00
ipc
kernel kernel/signal.c: trace_signal_deliver when signal_group_exit 2019-06-09 09:18:17 +02:00
lib kobject: Don't trigger kobject_uevent(KOBJ_REMOVE) twice. 2019-05-31 06:47:32 -07:00
mm memcg: make it work on sparse non-0-node systems 2019-06-09 09:18:17 +02:00
net tipc: fix modprobe tipc failed after switch order of device registration 2019-06-09 09:18:12 +02:00
samples samples: mei: use /dev/mei0 instead of /dev/mei 2019-02-15 08:09:12 +01:00
scripts gcc-plugins: Fix build failures under Darwin host 2019-06-09 09:18:19 +02:00
security ima: show rules with IMA_INMASK correctly 2019-06-09 09:18:18 +02:00
sound ALSA: hda/realtek - Set default power save node to 0 2019-06-09 09:18:16 +02:00
tools libbpf: fix samples/bpf build failure due to undefined UINT32_MAX 2019-05-31 06:47:22 -07:00
usr
virt KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 4.14.123 2019-05-31 06:47:36 -07:00
README

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.