x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
Peter Oberparleiter authored
commit 6583327c upstream.

Commit d61931d8

, "x86: Add optimized popcnt variants" introduced
compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
options -fprofile-arcs and -O2, this flag causes gcc to generate
broken constructor code. As a result, a 64 bit x86 kernel compiled
with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create
file" and runs into sproadic BUGs during boot.

The gcc people indicate that these kinds of problems are endemic when
using ad hoc calling conventions.  It is therefore best to treat any
file compiled with ad hoc calling conventions as an isolated
environment and avoid things like profiling or coverage analysis,
since those subsystems assume a "normal" calling conventions.

This patch avoids the bug by excluding lib/hweight.o from coverage
profiling.
Reported-by: default avatarMeelis Roos <mroos@linux.ee>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by:...
d2fc4a69
Name Last commit Last update
..
lzo lib: add support for LZO-compressed kernels
raid6 md: Add in export.h for files using EXPORT_SYMBOL
reed_solomon lib: Remove unnecessary inclusions of asm/semaphore.h
xz XZ: Fix incorrect XZ_BUF_ERROR
zlib_deflate zlib: slim down zlib_deflate() workspace when possible
zlib_inflate inflate_fast: sout is already a short so ptr arith was off by one.
.gitignore Add some basic .gitignore files
Kconfig llist: Make some llist functions inline
Kconfig.debug lib/Kconfig.debug: fix help message for DEFAULT_HUNG_TASK_TIMEOUT
Kconfig.kgdb mips,kgdb: kdb low level trap catch and stack trace
Kconfig.kmemcheck kmemcheck: depend on HAVE_ARCH_KMEMCHECK
Makefile x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
argv_split.c tree-wide: convert open calls to remove spaces to skip_spaces() lib function
atomic64.c lib: atomic64: Change the type of local lock to raw_spinlock_t
atomic64_test.c atomic: use <linux/atomic.h>
audit.c audit: support the "standard" <asm-generic/unistd.h>
average.c lib: Improve EWMA efficiency by using bitshifts
bcd.c rtc: BCD codeshrink
bch.c lib: add shared BCH ECC library
bitmap.c lib/bitmap.c: quiet sparse noise about address space
bitrev.c lib: export bitrev16
bsearch.c lib: Add generic binary search function to the kernel.
btree.c btree: fix tree corruption in btree_get_prev()
bug.c modules: Fix module_bug_list list corruption race
bust_spinlocks.c oops handling: ensure that any oops is flushed to the mtdoops console
check_signature.c
checksum.c
cmdline.c
cordic.c
cpu-notifier-error-inject.c
cpu_rmap.c
cpumask.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc16.c
crc32.c
crc32defs.h
crc7.c
crc8.c
ctype.c
debug_locks.c
debugobjects.c
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
devres.c
div64.c
dma-debug.c
dump_stack.c
dynamic_debug.c
extable.c
fault-inject.c
find_last_bit.c
find_next_bit.c
flex_array.c
gcd.c
gen_crc32table.c
genalloc.c
halfmd4.c
hexdump.c
hweight.c
idr.c
inflate.c
int_sqrt.c
iomap.c
iomap_copy.c
iommu-helper.c
ioremap.c
irq_regs.c
is_single_threaded.c
kasprintf.c
klist.c
kobject.c
kobject_uevent.c
kref.c
kstrtox.c
kstrtox.h
lcm.c
libcrc32c.c
list_debug.c
list_sort.c
llist.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
lru_cache.c
md5.c
nlattr.c
parser.c
percpu_counter.c
plist.c
prio_heap.c
prio_tree.c
proportions.c
radix-tree.c
random32.c
ratelimit.c
rational.c
rbtree.c
reciprocal_div.c
rwsem-spinlock.c
rwsem.c
scatterlist.c
sha1.c
show_mem.c
smp_processor_id.c
sort.c
spinlock_debug.c
string.c
string_helpers.c
swiotlb.c
syscall.c
test-kstrtox.c
textsearch.c
timerqueue.c
ts_bm.c
ts_fsm.c
ts_kmp.c
uuid.c
vsprintf.c