...
 
Commits (12)
  • SZ Lin (林上智)'s avatar
    kbuild: Fix inconsistent comment · 46b7c492
    SZ Lin (林上智) authored
    The commit 2042b548 ("kbuild: unset variables in top Makefile
    instead of setting 0") renamed the variable from "config-targets"
    to "config-build", the comment should be consistent accordingly.
    Signed-off-by: default avatarKaiden PK Yu (余泊鎧) <KaidenPK.Yu@moxa.com>
    Signed-off-by: default avatarSZ Lin (林上智) <sz.lin@moxa.com>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    46b7c492
  • Masahiro Yamada's avatar
    kconfig: introduce m32-flag and m64-flag · 8cc4fd73
    Masahiro Yamada authored
    When a compiler supports multiple architectures, some compiler features
    can be dependent on the target architecture.
    
    This is typical for Clang, which supports multiple LLVM backends.
    Even for GCC, we need to take care of biarch compiler cases.
    
    It is not a problem when we evaluate cc-option in Makefiles because
    cc-option is tested against the flag in question + $(KBUILD_CFLAGS).
    
    The cc-option in Kconfig, on the other hand, does not accumulate
    tested flags. Due to this simplification, it could potentially test
    cc-option against a different target.
    
    At first, Kconfig always evaluated cc-option against the host
    architecture.
    
    Since commit e8de12fb ("kbuild: Check for unknown options with
    cc-option usage in Kconfig and clang"), in case of cross-compiling
    with Clang, the target triple is correctly passed to Kconfig.
    
    The case with biarch GCC (and native build with Clang) is still not
    handled properly. We need to pass some flags to specify the target
    machine bit.
    
    Due to the design, all the macros in Kconfig are expanded in the
    parse stage, where we do not know the target bit size yet.
    
    For example, arch/x86/Kconfig allows a user to toggle CONFIG_64BIT.
    If a compiler flag -foo depends on the machine bit, it must be tested
    twice, one with -m32 and the other with -m64.
    
    However, -m32/-m64 are not always recognized. So, this commits adds
    m64-flag and m32-flag macros. They expand to -m32, -m64, respectively
    if supported. Or, they expand to an empty string if unsupported.
    
    The typical usage is like this:
    
      config FOO
              bool
              default $(cc-option,$(m64-flag) -foo) if 64BIT
              default $(cc-option,$(m32-flag) -foo)
    
    This is clumsy, but there is no elegant way to handle this in the
    current static macro expansion.
    
    There was discussion for static functions vs dynamic functions.
    The consensus was to go as far as possible with the static functions.
    (https://lkml.org/lkml/2018/3/2/22)
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Tested-by: default avatarGeorge Spelvin <lkml@sdf.org>
    Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    8cc4fd73
  • Masahiro Yamada's avatar
    int128: fix __uint128_t compiler test in Kconfig · 3a7c7331
    Masahiro Yamada authored
    The support for __uint128_t is dependent on the target bit size.
    
    GCC that defaults to the 32-bit can still build the 64-bit kernel
    with -m64 flag passed.
    
    However, $(cc-option,-D__SIZEOF_INT128__=0) is evaluated against the
    default machine bit, which may not match to the kernel it is building.
    
    Theoretically, this could be evaluated separately for 64BIT/32BIT.
    
      config CC_HAS_INT128
              bool
              default !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) if 64BIT
              default !$(cc-option,$(m32-flag) -D__SIZEOF_INT128__=0)
    
    I simplified it more because the 32-bit compiler is unlikely to support
    __uint128_t.
    
    Fixes: c12d3362 ("int128: move __uint128_t compiler test to Kconfig")
    Reported-by: default avatarGeorge Spelvin <lkml@sdf.org>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Tested-by: default avatarGeorge Spelvin <lkml@sdf.org>
    3a7c7331
  • Masahiro Yamada's avatar
    kbuild: doc: fix references to other documents · 2eebb7ab
    Masahiro Yamada authored
    All the files in Documentation/kbuild/ were converted to reST.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    2eebb7ab
  • Nathan Chancellor's avatar
    kbuild: Disable -Wpointer-to-enum-cast · 82f2bc2f
    Nathan Chancellor authored
    Clang's -Wpointer-to-int-cast deviates from GCC in that it warns when
    casting to enums. The kernel does this in certain places, such as device
    tree matches to set the version of the device being used, which allows
    the kernel to avoid using a gigantic union.
    
    https://elixir.bootlin.com/linux/v5.5.8/source/drivers/ata/ahci_brcm.c#L428
    https://elixir.bootlin.com/linux/v5.5.8/source/drivers/ata/ahci_brcm.c#L402
    https://elixir.bootlin.com/linux/v5.5.8/source/include/linux/mod_devicetable.h#L264
    
    To avoid a ton of false positive warnings, disable this particular part
    of the warning, which has been split off into a separate diagnostic so
    that the entire warning does not need to be turned off for clang. It
    will be visible under W=1 in case people want to go about fixing these
    easily and enabling the warning treewide.
    
    Cc: stable@vger.kernel.org
    Link: https://github.com/ClangBuiltLinux/linux/issues/887
    Link: https://github.com/llvm/llvm-project/commit/2a41b31fcdfcb67ab7038fc2ffb606fd50b83a84Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    82f2bc2f
  • Jessica Yu's avatar
    modpost: move the namespace field in Module.symvers last · 5190044c
    Jessica Yu authored
    In order to preserve backwards compatability with kmod tools, we have to
    move the namespace field in Module.symvers last, as the depmod -e -E
    option looks at the first three fields in Module.symvers to check symbol
    versions (and it's expected they stay in the original order of crc,
    symbol, module).
    
    In addition, update an ancient comment above read_dump() in modpost that
    suggested that the export type field in Module.symvers was optional. I
    suspect that there were historical reasons behind that comment that are
    no longer accurate. We have been unconditionally printing the export
    type since 2.6.18 (commit bd5cbced), which is over a decade ago now.
    
    Fix up read_dump() to treat each field as non-optional. I suspect the
    original read_dump() code treated the export field as optional in order
    to support pre <= 2.6.18 Module.symvers (which did not have the export
    type field). Note that although symbol namespaces are optional, the
    field will not be omitted from Module.symvers if a symbol does not have
    a namespace. In this case, the field will simply be empty and the next
    delimiter or end of line will follow.
    
    Cc: stable@vger.kernel.org
    Fixes: cb9b55d2 ("modpost: add support for symbol namespaces")
    Tested-by: default avatarMatthias Maennich <maennich@google.com>
    Reviewed-by: default avatarMatthias Maennich <maennich@google.com>
    Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
    Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    5190044c
  • Eugeniy Paltsev's avatar
    initramfs: restore default compression behavior · 785d74ec
    Eugeniy Paltsev authored
    Even though INITRAMFS_SOURCE kconfig option isn't set in most of
    defconfigs it is used (set) extensively by various build systems.
    Commit f26661e1 ("initramfs: make initramfs compression choice
    non-optional") has changed default compression mode. Previously we
    compress initramfs using available compression algorithm. Now
    we don't use any compression at all by default.
    It significantly increases the image size in case of build system
    chooses embedded initramfs. Initially I faced with this issue while
    using buildroot.
    
    As of today it's not possible to set preferred compression mode
    in target defconfig as this option depends on INITRAMFS_SOURCE
    being set. Modification of all build systems either doesn't look
    like good option.
    
    Let's instead rewrite initramfs compression mode choices list
    the way that "INITRAMFS_COMPRESSION_NONE" will be the last option
    in the list. In that case it will be chosen only if all other
    options (which implements any compression) are not available.
    Signed-off-by: default avatarEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    785d74ec
  • Xiao Yang's avatar
    modpost: Get proper section index by get_secindex() instead of st_shndx · 4b8a5cfb
    Xiao Yang authored
    (uint16_t) st_shndx is limited to 65535(i.e. SHN_XINDEX) so sym_get_data() gets
    wrong section index by st_shndx if requested symbol contains extended section
    index that is more than 65535.  In this case, we need to get proper section index
    by .symtab_shndx section.
    
    Module.symvers generated by building kernel with "-ffunction-sections -fdata-sections"
    shows the issue.
    
    Fixes: 56067812 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
    Fixes: e84f9fbb ("modpost: refactor namespace_from_kstrtabns() to not hard-code section name")
    Signed-off-by: default avatarXiao Yang <yangx.jy@cn.fujitsu.com>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    4b8a5cfb
  • Linus Torvalds's avatar
    locks: reinstate locks_delete_block optimization · dcf23ac3
    Linus Torvalds authored
    There is measurable performance impact in some synthetic tests due to
    commit 6d390e4b (locks: fix a potential use-after-free problem when
    wakeup a waiter). Fix the race condition instead by clearing the
    fl_blocker pointer after the wake_up, using explicit acquire/release
    semantics.
    
    This does mean that we can no longer use the clearing of fl_blocker as
    the wait condition, so switch the waiters over to checking whether the
    fl_blocked_member list_head is empty.
    Reviewed-by: default avataryangerkun <yangerkun@huawei.com>
    Reviewed-by: default avatarNeilBrown <neilb@suse.de>
    Fixes: 6d390e4b (locks: fix a potential use-after-free problem when wakeup a waiter)
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    dcf23ac3
  • Mikhail Petrov's avatar
    scripts/kallsyms: fix wrong kallsyms_relative_base · 7883a143
    Mikhail Petrov authored
    There is the code in the read_symbol function in 'scripts/kallsyms.c':
    
    	if (is_ignored_symbol(name, type))
    		return NULL;
    
    	/* Ignore most absolute/undefined (?) symbols. */
    	if (strcmp(name, "_text") == 0)
    		_text = addr;
    
    But the is_ignored_symbol function returns true for name="_text" and
    type='A'. So the next condition is not executed and the _text variable
    is always zero.
    
    It makes the wrong kallsyms_relative_base symbol as a result of the code
    (CONFIG_KALLSYMS_BASE_RELATIVE is defined):
    
    	if (base_relative) {
    		output_label("kallsyms_relative_base");
    		output_address(relative_base);
    		printf("\n");
    	}
    
    Because the output_address function uses the _text variable.
    
    So the kallsyms_lookup function and all related functions in the kernel
    do not work properly. For example, the stack trace in oops:
    
     Call Trace:
     [aa095e58] [809feab8] kobj_ns_ops_tbl+0x7ff09ac8/0x7ff1c1c4 (unreliable)
     [aa095e98] [80002b64] kobj_ns_ops_tbl+0x7f50db74/0x80000010
     [aa095ef8] [809c3d24] kobj_ns_ops_tbl+0x7feced34/0x7ff1c1c4
     [aa095f28] [80002ed0] kobj_ns_ops_tbl+0x7f50dee0/0x80000010
     [aa095f38] [8000f238] kobj_ns_ops_tbl+0x7f51a248/0x80000010
    
    The right stack trace:
    
     Call Trace:
     [aa095e58] [809feab8] module_vdu_video_init+0x2fc/0x3bc (unreliable)
     [aa095e98] [80002b64] do_one_initcall+0x40/0x1f0
     [aa095ef8] [809c3d24] kernel_init_freeable+0x164/0x1d8
     [aa095f28] [80002ed0] kernel_init+0x14/0x124
     [aa095f38] [8000f238] ret_from_kernel_thread+0x14/0x1c
    
    [masahiroy@kernel.org:
    
    This issue happens on binutils <= 2.22
    The following commit fixed it:
    https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d2667025dd30611514810c28bee9709e4623012a
    
    The symbol type of _text is 'T' on binutils >= 2.23
    The minimal supported binutils version for the kernel build is 2.21
    ]
    Signed-off-by: default avatarMikhail Petrov <Mikhail.Petrov@mir.dev>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    7883a143
  • Corentin Labbe's avatar
    rtc: max8907: add missing select REGMAP_IRQ · 5d892919
    Corentin Labbe authored
    I have hit the following build error:
    
      armv7a-hardfloat-linux-gnueabi-ld: drivers/rtc/rtc-max8907.o: in function `max8907_rtc_probe':
      rtc-max8907.c:(.text+0x400): undefined reference to `regmap_irq_get_virq'
    
    max8907 should select REGMAP_IRQ
    
    Fixes: 94c01ab6 ("rtc: add MAX8907 RTC driver")
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5d892919
  • Linus Torvalds's avatar
    Merge tag 'kbuild-fixes-v5.6-3' of... · 207f75c4
    Linus Torvalds authored
    Merge tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
    
    Pull Kbuild fixes from Masahiro Yamada:
    
     - fix __uint128_t capability test in Kconfig when GCC that defaults to
       32-bit is used to build the 64-bit kernel
    
     - suppress new noisy Clang warnings -Wpointer-to-enum-cast
    
     - move the namespace field in Module.symvers for the backward
       compatibility reason for the depmod tool
    
     - use available compression for initramdisk when INTRAMFS_SOURCE is
       defined, which was the original behavior
    
     - fix modpost to handle correct large section numbers when it refers to
       modversion CRCs and module namespaces
    
     - fix comments and documents
    
    * tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
      scripts/kallsyms: fix wrong kallsyms_relative_base
      modpost: Get proper section index by get_secindex() instead of st_shndx
      initramfs: restore default compression behavior
      modpost: move the namespace field in Module.symvers last
      kbuild: Disable -Wpointer-to-enum-cast
      kbuild: doc: fix references to other documents
      int128: fix __uint128_t compiler test in Kconfig
      kconfig: introduce m32-flag and m64-flag
      kbuild: Fix inconsistent comment
    207f75c4
......@@ -237,7 +237,7 @@ This is solely useful to speed up test compiles.
KBUILD_EXTRA_SYMBOLS
--------------------
For modules that use symbols from other modules.
See more details in modules.txt.
See more details in modules.rst.
ALLSOURCE_ARCHS
---------------
......
......@@ -44,7 +44,7 @@ intermediate::
def_bool y
Then, Kconfig moves onto the evaluation stage to resolve inter-symbol
dependency as explained in kconfig-language.txt.
dependency as explained in kconfig-language.rst.
Variables
......
......@@ -924,7 +924,7 @@ When kbuild executes, the following steps are followed (roughly):
$(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
are used for assembler.
From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
From commandline AFLAGS_MODULE shall be used (see kbuild.rst).
KBUILD_CFLAGS_KERNEL
$(CC) options specific for built-in
......@@ -937,7 +937,7 @@ When kbuild executes, the following steps are followed (roughly):
$(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
are used for $(CC).
From commandline CFLAGS_MODULE shall be used (see kbuild.txt).
From commandline CFLAGS_MODULE shall be used (see kbuild.rst).
KBUILD_LDFLAGS_MODULE
Options for $(LD) when linking modules
......@@ -945,7 +945,7 @@ When kbuild executes, the following steps are followed (roughly):
$(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
used when linking modules. This is often a linker script.
From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
From commandline LDFLAGS_MODULE shall be used (see kbuild.rst).
KBUILD_LDS
......
......@@ -470,9 +470,9 @@ build.
The syntax of the Module.symvers file is::
<CRC> <Symbol> <Namespace> <Module> <Export Type>
<CRC> <Symbol> <Module> <Export Type> <Namespace>
0xe1cc2a05 usb_stor_suspend USB_STORAGE drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL
0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
The fields are separated by tabs and values may be empty (e.g.
if no namespace is defined for an exported symbol).
......
......@@ -1804,7 +1804,7 @@ existing-targets := $(wildcard $(sort $(targets)))
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
endif # config-targets
endif # config-build
endif # mixed-build
endif # need-sub-make
......
......@@ -327,6 +327,7 @@ config RTC_DRV_MAX6900
config RTC_DRV_MAX8907
tristate "Maxim MAX8907"
depends on MFD_MAX8907 || COMPILE_TEST
select REGMAP_IRQ
help
If you say yes here you will get support for the
RTC of Maxim MAX8907 PMIC.
......
......@@ -1169,7 +1169,8 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
rc = posix_lock_file(file, flock, NULL);
up_write(&cinode->lock_sem);
if (rc == FILE_LOCK_DEFERRED) {
rc = wait_event_interruptible(flock->fl_wait, !flock->fl_blocker);
rc = wait_event_interruptible(flock->fl_wait,
list_empty(&flock->fl_blocked_member));
if (!rc)
goto try_again;
locks_delete_block(flock);
......
......@@ -725,7 +725,6 @@ static void __locks_delete_block(struct file_lock *waiter)
{
locks_delete_global_blocked(waiter);
list_del_init(&waiter->fl_blocked_member);
waiter->fl_blocker = NULL;
}
static void __locks_wake_up_blocks(struct file_lock *blocker)
......@@ -740,6 +739,13 @@ static void __locks_wake_up_blocks(struct file_lock *blocker)
waiter->fl_lmops->lm_notify(waiter);
else
wake_up(&waiter->fl_wait);
/*
* The setting of fl_blocker to NULL marks the "done"
* point in deleting a block. Paired with acquire at the top
* of locks_delete_block().
*/
smp_store_release(&waiter->fl_blocker, NULL);
}
}
......@@ -753,11 +759,42 @@ int locks_delete_block(struct file_lock *waiter)
{
int status = -ENOENT;
/*
* If fl_blocker is NULL, it won't be set again as this thread "owns"
* the lock and is the only one that might try to claim the lock.
*
* We use acquire/release to manage fl_blocker so that we can
* optimize away taking the blocked_lock_lock in many cases.
*
* The smp_load_acquire guarantees two things:
*
* 1/ that fl_blocked_requests can be tested locklessly. If something
* was recently added to that list it must have been in a locked region
* *before* the locked region when fl_blocker was set to NULL.
*
* 2/ that no other thread is accessing 'waiter', so it is safe to free
* it. __locks_wake_up_blocks is careful not to touch waiter after
* fl_blocker is released.
*
* If a lockless check of fl_blocker shows it to be NULL, we know that
* no new locks can be inserted into its fl_blocked_requests list, and
* can avoid doing anything further if the list is empty.
*/
if (!smp_load_acquire(&waiter->fl_blocker) &&
list_empty(&waiter->fl_blocked_requests))
return status;
spin_lock(&blocked_lock_lock);
if (waiter->fl_blocker)
status = 0;
__locks_wake_up_blocks(waiter);
__locks_delete_block(waiter);
/*
* The setting of fl_blocker to NULL marks the "done" point in deleting
* a block. Paired with acquire at the top of this function.
*/
smp_store_release(&waiter->fl_blocker, NULL);
spin_unlock(&blocked_lock_lock);
return status;
}
......@@ -1350,7 +1387,8 @@ static int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl)
error = posix_lock_inode(inode, fl, NULL);
if (error != FILE_LOCK_DEFERRED)
break;
error = wait_event_interruptible(fl->fl_wait, !fl->fl_blocker);
error = wait_event_interruptible(fl->fl_wait,
list_empty(&fl->fl_blocked_member));
if (error)
break;
}
......@@ -1435,7 +1473,8 @@ int locks_mandatory_area(struct inode *inode, struct file *filp, loff_t start,
error = posix_lock_inode(inode, &fl, NULL);
if (error != FILE_LOCK_DEFERRED)
break;
error = wait_event_interruptible(fl.fl_wait, !fl.fl_blocker);
error = wait_event_interruptible(fl.fl_wait,
list_empty(&fl.fl_blocked_member));
if (!error) {
/*
* If we've been sleeping someone might have
......@@ -1638,7 +1677,8 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
locks_dispose_list(&dispose);
error = wait_event_interruptible_timeout(new_fl->fl_wait,
!new_fl->fl_blocker, break_time);
list_empty(&new_fl->fl_blocked_member),
break_time);
percpu_down_read(&file_rwsem);
spin_lock(&ctx->flc_lock);
......@@ -2122,7 +2162,8 @@ static int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl)
error = flock_lock_inode(inode, fl);
if (error != FILE_LOCK_DEFERRED)
break;
error = wait_event_interruptible(fl->fl_wait, !fl->fl_blocker);
error = wait_event_interruptible(fl->fl_wait,
list_empty(&fl->fl_blocked_member));
if (error)
break;
}
......@@ -2399,7 +2440,8 @@ static int do_lock_file_wait(struct file *filp, unsigned int cmd,
error = vfs_lock_file(filp, cmd, fl, NULL);
if (error != FILE_LOCK_DEFERRED)
break;
error = wait_event_interruptible(fl->fl_wait, !fl->fl_blocker);
error = wait_event_interruptible(fl->fl_wait,
list_empty(&fl->fl_blocked_member));
if (error)
break;
}
......
......@@ -767,8 +767,7 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
bool
config CC_HAS_INT128
def_bool y
depends on !$(cc-option,-D__SIZEOF_INT128__=0)
def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
#
# For architectures that know their GCC __int128 support is sound
......
......@@ -44,3 +44,10 @@ $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supporte
# gcc version including patch level
gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
# machine bit flags
# $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise.
# $(m64-flag): -m64 if the compiler supports it, or an empty string otherwise.
cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$(1))
m32-flag := $(cc-option-bit,-m32)
m64-flag := $(cc-option-bit,-m64)
......@@ -48,6 +48,7 @@ KBUILD_CFLAGS += -Wno-initializer-overrides
KBUILD_CFLAGS += -Wno-format
KBUILD_CFLAGS += -Wno-sign-compare
KBUILD_CFLAGS += -Wno-format-zero-length
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
endif
endif
......
......@@ -94,7 +94,7 @@ if (defined $opt{'o'}) {
#
while ( <$module_symvers> ) {
chomp;
my (undef, $symbol, $namespace, $module, $gpl) = split('\t');
my (undef, $symbol, $module, $gpl, $namespace) = split('\t');
$SYMBOL { $symbol } = [ $module , "0" , $symbol, $gpl];
}
close($module_symvers);
......
......@@ -195,13 +195,13 @@ static struct sym_entry *read_symbol(FILE *in)
return NULL;
}
if (is_ignored_symbol(name, type))
return NULL;
/* Ignore most absolute/undefined (?) symbols. */
if (strcmp(name, "_text") == 0)
_text = addr;
/* Ignore most absolute/undefined (?) symbols. */
if (is_ignored_symbol(name, type))
return NULL;
check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges));
check_symbol_range(name, addr, &percpu_range, 1);
......
......@@ -308,7 +308,8 @@ static const char *sec_name(struct elf_info *elf, int secindex)
static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym)
{
Elf_Shdr *sechdr = &info->sechdrs[sym->st_shndx];
unsigned int secindex = get_secindex(info, sym);
Elf_Shdr *sechdr = &info->sechdrs[secindex];
unsigned long offset;
offset = sym->st_value;
......@@ -2427,7 +2428,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
}
/* parse Module.symvers file. line format:
* 0x12345678<tab>symbol<tab>module[[<tab>export]<tab>something]
* 0x12345678<tab>symbol<tab>module<tab>export<tab>namespace
**/
static void read_dump(const char *fname, unsigned int kernel)
{
......@@ -2440,7 +2441,7 @@ static void read_dump(const char *fname, unsigned int kernel)
return;
while ((line = get_next_line(&pos, file, size))) {
char *symname, *namespace, *modname, *d, *export, *end;
char *symname, *namespace, *modname, *d, *export;
unsigned int crc;
struct module *mod;
struct symbol *s;
......@@ -2448,16 +2449,16 @@ static void read_dump(const char *fname, unsigned int kernel)
if (!(symname = strchr(line, '\t')))
goto fail;
*symname++ = '\0';
if (!(namespace = strchr(symname, '\t')))
goto fail;
*namespace++ = '\0';
if (!(modname = strchr(namespace, '\t')))
if (!(modname = strchr(symname, '\t')))
goto fail;
*modname++ = '\0';
if ((export = strchr(modname, '\t')) != NULL)
*export++ = '\0';
if (export && ((end = strchr(export, '\t')) != NULL))
*end = '\0';
if (!(export = strchr(modname, '\t')))
goto fail;
*export++ = '\0';
if (!(namespace = strchr(export, '\t')))
goto fail;
*namespace++ = '\0';
crc = strtoul(line, &d, 16);
if (*symname == '\0' || *modname == '\0' || *d != '\0')
goto fail;
......@@ -2508,9 +2509,9 @@ static void write_dump(const char *fname)
namespace = symbol->namespace;
buf_printf(&buf, "0x%08x\t%s\t%s\t%s\t%s\n",
symbol->crc, symbol->name,
namespace ? namespace : "",
symbol->module->name,
export_str(symbol->export));
export_str(symbol->export),
namespace ? namespace : "");
}
symbol = symbol->next;
}
......
......@@ -124,17 +124,6 @@ choice
If in doubt, select 'None'
config INITRAMFS_COMPRESSION_NONE
bool "None"
help
Do not compress the built-in initramfs at all. This may sound wasteful
in space, but, you should be aware that the built-in initramfs will be
compressed at a later stage anyways along with the rest of the kernel,
on those architectures that support this. However, not compressing the
initramfs may lead to slightly higher memory consumption during a
short time at boot, while both the cpio image and the unpacked
filesystem image will be present in memory simultaneously
config INITRAMFS_COMPRESSION_GZIP
bool "Gzip"
depends on RD_GZIP
......@@ -207,4 +196,15 @@ config INITRAMFS_COMPRESSION_LZ4
If you choose this, keep in mind that most distros don't provide lz4
by default which could cause a build failure.
config INITRAMFS_COMPRESSION_NONE
bool "None"
help
Do not compress the built-in initramfs at all. This may sound wasteful
in space, but, you should be aware that the built-in initramfs will be
compressed at a later stage anyways along with the rest of the kernel,
on those architectures that support this. However, not compressing the
initramfs may lead to slightly higher memory consumption during a
short time at boot, while both the cpio image and the unpacked
filesystem image will be present in memory simultaneously
endchoice