Revision a33b8ff3d6cb996ae964dc04a99c536f31fc463f authored by Ulrich Weigand on 12 January 2016, 12:14:23 UTC, committed by Greg Kroah-Hartman on 31 January 2016, 19:23:39 UTC
commit a61674bdfc7c2bf909c4010699607b62b69b7bec upstream.

GCC 6 will include changes to generated code with -mcmodel=large,
which is used to build kernel modules on powerpc64le.  This was
necessary because the large model is supposed to allow arbitrary
sizes and locations of the code and data sections, but the ELFv2
global entry point prolog still made the unconditional assumption
that the TOC associated with any particular function can be found
within 2 GB of the function entry point:

func:
	addis r2,r12,(.TOC.-func)@ha
	addi  r2,r2,(.TOC.-func)@l
	.localentry func, .-func

To remove this assumption, GCC will now generate instead this global
entry point prolog sequence when using -mcmodel=large:

	.quad .TOC.-func
func:
	.reloc ., R_PPC64_ENTRY
	ld    r2, -8(r12)
	add   r2, r2, r12
	.localentry func, .-func

The new .reloc triggers an optimization in the linker that will
replace this new prolog with the original code (see above) if the
linker determines that the distance between .TOC. and func is in
range after all.

Since this new relocation is now present in module object files,
the kernel module loader is required to handle them too.  This
patch adds support for the new relocation and implements the
same optimization done by the GNU linker.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

1 parent 1e2c53f
History
File Mode Size
kasan
Kconfig -rw-r--r-- 21.3 KB
Kconfig.debug -rw-r--r-- 1.2 KB
Makefile -rw-r--r-- 2.6 KB
backing-dev.c -rw-r--r-- 15.0 KB
balloon_compaction.c -rw-r--r-- 6.8 KB
bootmem.c -rw-r--r-- 20.8 KB
cleancache.c -rw-r--r-- 9.9 KB
cma.c -rw-r--r-- 12.1 KB
cma.h -rw-r--r-- 508 bytes
cma_debug.c -rw-r--r-- 4.4 KB
compaction.c -rw-r--r-- 47.3 KB
debug-pagealloc.c -rw-r--r-- 2.6 KB
debug.c -rw-r--r-- 6.5 KB
dmapool.c -rw-r--r-- 13.7 KB
early_ioremap.c -rw-r--r-- 5.4 KB
fadvise.c -rw-r--r-- 3.7 KB
failslab.c -rw-r--r-- 1.3 KB
filemap.c -rw-r--r-- 69.8 KB
frontswap.c -rw-r--r-- 13.4 KB
gup.c -rw-r--r-- 39.0 KB
highmem.c -rw-r--r-- 11.8 KB
huge_memory.c -rw-r--r-- 79.1 KB
hugetlb.c -rw-r--r-- 103.2 KB
hugetlb_cgroup.c -rw-r--r-- 10.4 KB
hwpoison-inject.c -rw-r--r-- 3.3 KB
init-mm.c -rw-r--r-- 619 bytes
internal.h -rw-r--r-- 13.6 KB
interval_tree.c -rw-r--r-- 3.1 KB
kmemcheck.c -rw-r--r-- 2.9 KB
kmemleak-test.c -rw-r--r-- 3.2 KB
kmemleak.c -rw-r--r-- 53.8 KB
ksm.c -rw-r--r-- 63.3 KB
list_lru.c -rw-r--r-- 12.2 KB
maccess.c -rw-r--r-- 1.6 KB
madvise.c -rw-r--r-- 13.8 KB
memblock.c -rw-r--r-- 45.0 KB
memcontrol.c -rw-r--r-- 149.6 KB
memory-failure.c -rw-r--r-- 49.2 KB
memory.c -rw-r--r-- 103.9 KB
memory_hotplug.c -rw-r--r-- 51.1 KB
mempolicy.c -rw-r--r-- 70.6 KB
mempool.c -rw-r--r-- 13.9 KB
memtest.c -rw-r--r-- 3.0 KB
migrate.c -rw-r--r-- 46.7 KB
mincore.c -rw-r--r-- 6.6 KB
mlock.c -rw-r--r-- 19.5 KB
mm_init.c -rw-r--r-- 5.1 KB
mmap.c -rw-r--r-- 89.8 KB
mmu_context.c -rw-r--r-- 1.3 KB
mmu_notifier.c -rw-r--r-- 11.4 KB
mmzone.c -rw-r--r-- 2.3 KB
mprotect.c -rw-r--r-- 10.5 KB
mremap.c -rw-r--r-- 15.1 KB
msync.c -rw-r--r-- 2.6 KB
nobootmem.c -rw-r--r-- 10.7 KB
nommu.c -rw-r--r-- 53.7 KB
oom_kill.c -rw-r--r-- 23.1 KB
page-writeback.c -rw-r--r-- 74.3 KB
page_alloc.c -rw-r--r-- 183.3 KB
page_counter.c -rw-r--r-- 4.8 KB
page_ext.c -rw-r--r-- 10.3 KB
page_io.c -rw-r--r-- 9.4 KB
page_isolation.c -rw-r--r-- 8.7 KB
page_owner.c -rw-r--r-- 7.0 KB
pagewalk.c -rw-r--r-- 7.5 KB
percpu-km.c -rw-r--r-- 2.8 KB
percpu-vm.c -rw-r--r-- 10.0 KB
percpu.c -rw-r--r-- 66.1 KB
pgtable-generic.c -rw-r--r-- 5.1 KB
process_vm_access.c -rw-r--r-- 9.8 KB
quicklist.c -rw-r--r-- 2.4 KB
readahead.c -rw-r--r-- 15.6 KB
rmap.c -rw-r--r-- 43.5 KB
shmem.c -rw-r--r-- 89.5 KB
slab.c -rw-r--r-- 107.3 KB
slab.h -rw-r--r-- 10.4 KB
slab_common.c -rw-r--r-- 26.9 KB
slob.c -rw-r--r-- 15.7 KB
slub.c -rw-r--r-- 127.3 KB
sparse-vmemmap.c -rw-r--r-- 6.0 KB
sparse.c -rw-r--r-- 20.9 KB
swap.c -rw-r--r-- 32.1 KB
swap_cgroup.c -rw-r--r-- 4.6 KB
swap_state.c -rw-r--r-- 12.7 KB
swapfile.c -rw-r--r-- 77.0 KB
truncate.c -rw-r--r-- 23.5 KB
util.c -rw-r--r-- 10.9 KB
vmacache.c -rw-r--r-- 3.1 KB
vmalloc.c -rw-r--r-- 69.0 KB
vmpressure.c -rw-r--r-- 11.4 KB
vmscan.c -rw-r--r-- 109.0 KB
vmstat.c -rw-r--r-- 40.7 KB
workingset.c -rw-r--r-- 13.6 KB
zbud.c -rw-r--r-- 17.9 KB
zpool.c -rw-r--r-- 9.6 KB
zsmalloc.c -rw-r--r-- 45.5 KB
zswap.c -rw-r--r-- 24.9 KB

back to top