Message ID | 20161101042219.25587-1-npiggin@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tue, 1 Nov 2016 15:22:19 +1100 Nicholas Piggin <npiggin@gmail.com> wrote: > The powerpc64 linker generates fpr save/restore functions on-demand, > placing them in the .sfpr section. So remove the explicitly coded ones > from the 64 build. > > Have 32-bit put save/restore functions into .sfpr section rather than > .text, to match 64-bit. > > And explicitly have the linker script place the section rather than > leaving it as orphan. > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > --- > > I tested this with 64-bit optimize-for-size build with modules, > and that works okay. No I didn't, it's broken. I'll send an update shortly. Thanks, Nick
Hi Nicholas,
[auto build test ERROR on v4.9-rc3]
[also build test ERROR on next-20161028]
[cannot apply to powerpc/next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-fpr-save-restore-function-cleanups/20161101-122547
config: powerpc-mvme5100_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
>> arch/powerpc/boot/crtsavres.S:232:0: error: #endif without #if
#endif
vim +232 arch/powerpc/boot/crtsavres.S
143580ec Kumar Gala 2008-06-13 226 _GLOBAL(_rest32gpr_31_x)
143580ec Kumar Gala 2008-06-13 227 lwz 0,4(11)
143580ec Kumar Gala 2008-06-13 228 lwz 31,-4(11)
143580ec Kumar Gala 2008-06-13 229 mtlr 0
143580ec Kumar Gala 2008-06-13 230 mr 1,11
143580ec Kumar Gala 2008-06-13 231 blr
143580ec Kumar Gala 2008-06-13 @232 #endif
:::::: The code at line 232 was first introduced by commit
:::::: 143580ecfb7999147e546cc3814023e233e95fa5 [POWERPC] Fix bootwrapper builds with newer gcc versions
:::::: TO: Kumar Gala <galak@kernel.crashing.org>
:::::: CC: Paul Mackerras <paulus@samba.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Nicholas, [auto build test ERROR on v4.9-rc3] [also build test ERROR on next-20161028] [cannot apply to powerpc/next] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-fpr-save-restore-function-cleanups/20161101-122547 config: powerpc-defconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=powerpc All errors (new ones prefixed by >>): arch/powerpc/boot/of.o: In function `of_try_claim': >> of.c:(.text+0x88): undefined reference to `_restgpr_28_x' arch/powerpc/boot/of.o: In function `of_image_hdr': >> of.c:(.text+0x104): undefined reference to `_restgpr_30_x' arch/powerpc/boot/of.o: In function `platform_init': of.c:(.text+0x1b4): undefined reference to `_restgpr_28_x' arch/powerpc/boot/epapr.o: In function `platform_fixups': >> epapr.c:(.text+0xb0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/epapr.o: In function `epapr_platform_init': epapr.c:(.text+0x114): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `expand_buf': >> libfdt-wrapper.c:(.text+0xa0): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finalize': >> libfdt-wrapper.c:(.text+0xf4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_path': libfdt-wrapper.c:(.text+0x180): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_del_node': libfdt-wrapper.c:(.text+0x1c4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_compatible': libfdt-wrapper.c:(.text+0x20c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_prop_value': libfdt-wrapper.c:(.text+0x254): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_create_node': >> libfdt-wrapper.c:(.text+0x2d0): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_parent': libfdt-wrapper.c:(.text+0x320): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_setprop': >> libfdt-wrapper.c:(.text+0x3e4): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_getprop': libfdt-wrapper.c:(.text+0x4a4): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finddevice': libfdt-wrapper.c:(.text+0x4e0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_init': libfdt-wrapper.c:(.text+0x5d8): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(main.o): In function `prep_kernel': >> main.c:(.text+0x174): undefined reference to `_restgpr_24_x' arch/powerpc/boot/wrapper.a(ofconsole.o): In function `of_console_write': >> ofconsole.c:(.text+0x44): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(ofconsole.o): In function `of_console_open': ofconsole.c:(.text+0xa0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(ofconsole.o): In function `of_console_init': ofconsole.c:(.text+0xdc): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_call_prom_ret.constprop.1': >> oflib.c:(.text+0x104): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_init': oflib.c:(.text+0x144): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_call_prom': >> oflib.c:(.text+0x240): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_exit': oflib.c:(.text+0x2d0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_finddevice': oflib.c:(.text+0x30c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_getprop': oflib.c:(.text+0x354): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_claim': >> oflib.c:(.text+0x3e8): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_vmlinux_alloc': >> oflib.c:(.text+0x654): undefined reference to `_restgpr_27_x' arch/powerpc/boot/wrapper.a(oflib.o): In function `of_setprop': oflib.c:(.text+0x6a8): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_open': >> serial.c:(.text+0x38): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_write': >> serial.c:(.text+0x78): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_close': serial.c:(.text+0xcc): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_edit_cmdline': >> serial.c:(.text+0x158): undefined reference to `_restgpr_24_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_get_stdout_devp': serial.c:(.text+0x2e4): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(serial.o): In function `serial_console_init': serial.c:(.text+0x31c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_malloc': >> simple_alloc.c:(.text+0xa0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_find_entry': simple_alloc.c:(.text+0x114): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_free': simple_alloc.c:(.text+0x16c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_realloc': >> simple_alloc.c:(.text+0x20c): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_alloc_init': simple_alloc.c:(.text+0x2b0): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `number': >> stdio.c:(.text+0x2ec): undefined reference to `_restgpr_20_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `vsprintf': >> stdio.c:(.text+0x3e4): undefined reference to `_restgpr_23_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `sprintf': -- arch/powerpc/boot/ps3.o: In function `ps3_copy_vectors': >> ps3.c:(.text+0x90): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `finddevice': >> devtree.c:(.text+0x3c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `getprop': devtree.c:(.text+0x84): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `setprop': devtree.c:(.text+0xcc): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `copy_val': >> devtree.c:(.text+0x12c): undefined reference to `_restgpr_27_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_fixup_memory': >> devtree.c:(.text+0x2dc): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_fixup_cpu_clocks': devtree.c:(.text+0x3c8): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_fixup_clock': >> devtree.c:(.text+0x4a8): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_fixup_mac_address_by_alias': devtree.c:(.text+0x54c): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_fixup_mac_address': >> devtree.c:(.text+0x5e4): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `__dt_fixup_mac_addresses': devtree.c:(.text+0x66c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_get_reg_format': devtree.c:(.text+0x704): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_xlate': >> devtree.c:(.text+0x740): undefined reference to `_restgpr_14_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_is_compatible': devtree.c:(.text+0xba8): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(devtree.o): In function `dt_get_virtual_reg': devtree.c:(.text+0xc7c): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `expand_buf': >> libfdt-wrapper.c:(.text+0xa0): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finalize': >> libfdt-wrapper.c:(.text+0xf4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_path': libfdt-wrapper.c:(.text+0x180): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_del_node': libfdt-wrapper.c:(.text+0x1c4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_compatible': libfdt-wrapper.c:(.text+0x20c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_prop_value': libfdt-wrapper.c:(.text+0x254): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_create_node': >> libfdt-wrapper.c:(.text+0x2d0): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_parent': libfdt-wrapper.c:(.text+0x320): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_setprop': >> libfdt-wrapper.c:(.text+0x3e4): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_getprop': libfdt-wrapper.c:(.text+0x4a4): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finddevice': libfdt-wrapper.c:(.text+0x4e0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_init': libfdt-wrapper.c:(.text+0x5d8): undefined reference to `_restgpr_29_x' arch/powerpc/boot/wrapper.a(main.o): In function `prep_kernel': >> main.c:(.text+0x174): undefined reference to `_restgpr_24_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_malloc': >> simple_alloc.c:(.text+0xa0): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_find_entry': simple_alloc.c:(.text+0x114): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_free': simple_alloc.c:(.text+0x16c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_realloc': >> simple_alloc.c:(.text+0x20c): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_alloc_init': simple_alloc.c:(.text+0x2b0): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `number': >> stdio.c:(.text+0x2ec): undefined reference to `_restgpr_20_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `vsprintf': >> stdio.c:(.text+0x3e4): undefined reference to `_restgpr_23_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `sprintf': >> stdio.c:(.text+0xae4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(stdio.o): In function `printf': stdio.c:(.text+0xb80): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `malloc': >> decompress.c:(.text+0x3c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `free': decompress.c:(.text+0x84): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `zlib_adler32': decompress.c:(.text+0xc4): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `zlib_updatewindow': >> decompress.c:(.text+0x290): undefined reference to `_restgpr_26_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `flush': >> decompress.c:(.text+0x364): undefined reference to `_restgpr_28_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `print_err': decompress.c:(.text+0x41c): undefined reference to `_restgpr_30_x' arch/powerpc/boot/wrapper.a(decompress.o): In function `zlib_inflate_table': -- arch/powerpc/boot/epapr.o: In function `platform_fixups': >> epapr.c:(.text+0xb0): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/epapr.o: In function `epapr_platform_init': epapr.c:(.text+0x114): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/epapr-wrapper.o: In function `platform_init': >> epapr-wrapper.c:(.text+0x28): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `expand_buf': >> libfdt-wrapper.c:(.text+0xa0): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finalize': >> libfdt-wrapper.c:(.text+0xf4): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_path': libfdt-wrapper.c:(.text+0x180): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_del_node': libfdt-wrapper.c:(.text+0x1c4): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_compatible': libfdt-wrapper.c:(.text+0x20c): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_find_node_by_prop_value': libfdt-wrapper.c:(.text+0x254): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_create_node': >> libfdt-wrapper.c:(.text+0x2d0): undefined reference to `_restgpr_28_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_get_parent': libfdt-wrapper.c:(.text+0x320): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_setprop': >> libfdt-wrapper.c:(.text+0x3e4): undefined reference to `_restgpr_26_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_getprop': libfdt-wrapper.c:(.text+0x4a4): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_wrapper_finddevice': libfdt-wrapper.c:(.text+0x4e0): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(libfdt-wrapper.o): In function `fdt_init': libfdt-wrapper.c:(.text+0x5d8): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(main.o): In function `prep_kernel': >> main.c:(.text+0x174): undefined reference to `_restgpr_24_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_open': >> serial.c:(.text+0x38): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_write': >> serial.c:(.text+0x78): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_close': serial.c:(.text+0xcc): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_edit_cmdline': >> serial.c:(.text+0x158): undefined reference to `_restgpr_24_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_get_stdout_devp': serial.c:(.text+0x2e4): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(serial.o): In function `serial_console_init': serial.c:(.text+0x31c): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_malloc': >> simple_alloc.c:(.text+0xa0): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_find_entry': simple_alloc.c:(.text+0x114): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_free': simple_alloc.c:(.text+0x16c): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_realloc': >> simple_alloc.c:(.text+0x20c): undefined reference to `_restgpr_28_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(simple_alloc.o): In function `simple_alloc_init': simple_alloc.c:(.text+0x2b0): undefined reference to `_restgpr_28_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(stdio.o): In function `number': >> stdio.c:(.text+0x2ec): undefined reference to `_restgpr_20_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(stdio.o): In function `vsprintf': >> stdio.c:(.text+0x3e4): undefined reference to `_restgpr_23_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(stdio.o): In function `sprintf': >> stdio.c:(.text+0xae4): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(stdio.o): In function `printf': stdio.c:(.text+0xb80): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(uartlite.o): In function `uartlite_open': >> uartlite.c:(.text+0x3c): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(uartlite.o): In function `uartlite_putc': uartlite.c:(.text+0x84): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(uartlite.o): In function `uartlite_getc': uartlite.c:(.text+0xe4): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(uartlite.o):uartlite.c:(.text+0x134): more undefined references to `_restgpr_30_x' follow powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(uartlite.o): In function `uartlite_console_init': >> uartlite.c:(.text+0x198): undefined reference to `_restgpr_29_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `cpm1_cmd': >> cpm-serial.c:(.text+0x70): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `cpm2_cmd': cpm-serial.c:(.text+0xe0): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `smc_disable_port': cpm-serial.c:(.text+0x138): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `scc_disable_port': cpm-serial.c:(.text+0x190): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `smc_enable_port': cpm-serial.c:(.text+0x1e8): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o):cpm-serial.c:(.text+0x240): more undefined references to `_restgpr_30_x' follow powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(cpm-serial.o): In function `cpm_console_init': >> cpm-serial.c:(.text+0x68c): undefined reference to `_restgpr_26_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(decompress.o): In function `malloc': >> decompress.c:(.text+0x3c): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(decompress.o): In function `free': decompress.c:(.text+0x84): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(decompress.o): In function `zlib_adler32': decompress.c:(.text+0xc4): undefined reference to `_restgpr_30_x' powerpc64-linux-gnu-ld: BFD (GNU Binutils for Debian) 2.27 assertion fail ../../bfd/elf32-ppc.c:8813 arch/powerpc/boot/wrapper.a(decompress.o): In function `zlib_updatewindow': --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index fe76cfe..c506f1e 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -179,7 +179,9 @@ else CHECKFLAGS += -D__LITTLE_ENDIAN__ endif +ifeq ($(CONFIG_PPC32),y) KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +endif ifeq ($(CONFIG_476FPE_ERR46),y) KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index eae2dc8..6abee93 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -95,12 +95,13 @@ libfdtheader := fdt.h libfdt.h libfdt_internal.h $(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o opal.o): \ $(addprefix $(obj)/,$(libfdtheader)) -src-wlib-y := string.S crt0.S crtsavres.S stdio.c decompress.c main.c \ +src-wlib-y := string.S crt0.S stdio.c decompress.c main.c \ $(libfdt) libfdt-wrapper.c \ ns16550.c serial.c simple_alloc.c div64.S util.S \ elf_util.c $(zlib-y) devtree.c stdlib.c \ oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \ uartlite.c mpc52xx-psc.c opal.c opal-calls.S +src-wlib-$(CONFIG_PPC32) += crtsavres.S src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c diff --git a/arch/powerpc/boot/crtsavres.S b/arch/powerpc/boot/crtsavres.S index f3d9b35..8c77437 100644 --- a/arch/powerpc/boot/crtsavres.S +++ b/arch/powerpc/boot/crtsavres.S @@ -38,10 +38,9 @@ */ .file "crtsavres.S" - .section ".text" + .section ".sfpr","ax",@progbits /* On PowerPC64 Linux, these functions are provided by the linker. */ -#ifndef __powerpc64__ #define _GLOBAL(name) \ .type name,@function; \ diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index a09c666..63775d9 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -84,6 +84,12 @@ SECTIONS KPROBES_TEXT IRQENTRY_TEXT SOFTIRQENTRY_TEXT + /* + * Linker puts .sfpr at the beginning of a group of input + * sections, which can break start-of-text offset if it is + * included with the main text sections. + */ + *(.sfpr); MEM_KEEP(init.text) MEM_KEEP(exit.text) diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 309361e8..b1304113 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -9,10 +9,9 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE) -obj-y += string.o alloc.o crtsavres.o code-patching.o \ - feature-fixups.o +obj-y += string.o alloc.o code-patching.o feature-fixups.o -obj-$(CONFIG_PPC32) += div64.o copy_32.o +obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o obj64-y += copypage_64.o copyuser_64.o usercopy_64.o mem_64.o hweight_64.o \ copyuser_power7.o string_64.o copypage_power7.o memcpy_power7.o \ diff --git a/arch/powerpc/lib/crtsavres.S b/arch/powerpc/lib/crtsavres.S index 18af0b3..0c6ea3b 100644 --- a/arch/powerpc/lib/crtsavres.S +++ b/arch/powerpc/lib/crtsavres.S @@ -42,11 +42,11 @@ .file "crtsavres.S" -#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE +/* On PowerPC64 Linux, these functions are provided by the linker. */ -#ifndef CONFIG_PPC64 +#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE - .section ".text" + .section ".sfpr","ax",@progbits /* Routines for saving integer registers, called by the compiler. */ /* Called with r11 pointing to the stack header word of the caller of the */ @@ -312,236 +312,4 @@ _GLOBAL(_restvr_31) #endif /* CONFIG_ALTIVEC */ -#else /* CONFIG_PPC64 */ - - .section ".text.save.restore","ax",@progbits - -.globl _savegpr0_14 -_savegpr0_14: - std r14,-144(r1) -.globl _savegpr0_15 -_savegpr0_15: - std r15,-136(r1) -.globl _savegpr0_16 -_savegpr0_16: - std r16,-128(r1) -.globl _savegpr0_17 -_savegpr0_17: - std r17,-120(r1) -.globl _savegpr0_18 -_savegpr0_18: - std r18,-112(r1) -.globl _savegpr0_19 -_savegpr0_19: - std r19,-104(r1) -.globl _savegpr0_20 -_savegpr0_20: - std r20,-96(r1) -.globl _savegpr0_21 -_savegpr0_21: - std r21,-88(r1) -.globl _savegpr0_22 -_savegpr0_22: - std r22,-80(r1) -.globl _savegpr0_23 -_savegpr0_23: - std r23,-72(r1) -.globl _savegpr0_24 -_savegpr0_24: - std r24,-64(r1) -.globl _savegpr0_25 -_savegpr0_25: - std r25,-56(r1) -.globl _savegpr0_26 -_savegpr0_26: - std r26,-48(r1) -.globl _savegpr0_27 -_savegpr0_27: - std r27,-40(r1) -.globl _savegpr0_28 -_savegpr0_28: - std r28,-32(r1) -.globl _savegpr0_29 -_savegpr0_29: - std r29,-24(r1) -.globl _savegpr0_30 -_savegpr0_30: - std r30,-16(r1) -.globl _savegpr0_31 -_savegpr0_31: - std r31,-8(r1) - std r0,16(r1) - blr - -.globl _restgpr0_14 -_restgpr0_14: - ld r14,-144(r1) -.globl _restgpr0_15 -_restgpr0_15: - ld r15,-136(r1) -.globl _restgpr0_16 -_restgpr0_16: - ld r16,-128(r1) -.globl _restgpr0_17 -_restgpr0_17: - ld r17,-120(r1) -.globl _restgpr0_18 -_restgpr0_18: - ld r18,-112(r1) -.globl _restgpr0_19 -_restgpr0_19: - ld r19,-104(r1) -.globl _restgpr0_20 -_restgpr0_20: - ld r20,-96(r1) -.globl _restgpr0_21 -_restgpr0_21: - ld r21,-88(r1) -.globl _restgpr0_22 -_restgpr0_22: - ld r22,-80(r1) -.globl _restgpr0_23 -_restgpr0_23: - ld r23,-72(r1) -.globl _restgpr0_24 -_restgpr0_24: - ld r24,-64(r1) -.globl _restgpr0_25 -_restgpr0_25: - ld r25,-56(r1) -.globl _restgpr0_26 -_restgpr0_26: - ld r26,-48(r1) -.globl _restgpr0_27 -_restgpr0_27: - ld r27,-40(r1) -.globl _restgpr0_28 -_restgpr0_28: - ld r28,-32(r1) -.globl _restgpr0_29 -_restgpr0_29: - ld r0,16(r1) - ld r29,-24(r1) - mtlr r0 - ld r30,-16(r1) - ld r31,-8(r1) - blr - -.globl _restgpr0_30 -_restgpr0_30: - ld r30,-16(r1) -.globl _restgpr0_31 -_restgpr0_31: - ld r0,16(r1) - ld r31,-8(r1) - mtlr r0 - blr - -#ifdef CONFIG_ALTIVEC -/* Called with r0 pointing just beyond the end of the vector save area. */ - -.globl _savevr_20 -_savevr_20: - li r12,-192 - stvx v20,r12,r0 -.globl _savevr_21 -_savevr_21: - li r12,-176 - stvx v21,r12,r0 -.globl _savevr_22 -_savevr_22: - li r12,-160 - stvx v22,r12,r0 -.globl _savevr_23 -_savevr_23: - li r12,-144 - stvx v23,r12,r0 -.globl _savevr_24 -_savevr_24: - li r12,-128 - stvx v24,r12,r0 -.globl _savevr_25 -_savevr_25: - li r12,-112 - stvx v25,r12,r0 -.globl _savevr_26 -_savevr_26: - li r12,-96 - stvx v26,r12,r0 -.globl _savevr_27 -_savevr_27: - li r12,-80 - stvx v27,r12,r0 -.globl _savevr_28 -_savevr_28: - li r12,-64 - stvx v28,r12,r0 -.globl _savevr_29 -_savevr_29: - li r12,-48 - stvx v29,r12,r0 -.globl _savevr_30 -_savevr_30: - li r12,-32 - stvx v30,r12,r0 -.globl _savevr_31 -_savevr_31: - li r12,-16 - stvx v31,r12,r0 - blr - -.globl _restvr_20 -_restvr_20: - li r12,-192 - lvx v20,r12,r0 -.globl _restvr_21 -_restvr_21: - li r12,-176 - lvx v21,r12,r0 -.globl _restvr_22 -_restvr_22: - li r12,-160 - lvx v22,r12,r0 -.globl _restvr_23 -_restvr_23: - li r12,-144 - lvx v23,r12,r0 -.globl _restvr_24 -_restvr_24: - li r12,-128 - lvx v24,r12,r0 -.globl _restvr_25 -_restvr_25: - li r12,-112 - lvx v25,r12,r0 -.globl _restvr_26 -_restvr_26: - li r12,-96 - lvx v26,r12,r0 -.globl _restvr_27 -_restvr_27: - li r12,-80 - lvx v27,r12,r0 -.globl _restvr_28 -_restvr_28: - li r12,-64 - lvx v28,r12,r0 -.globl _restvr_29 -_restvr_29: - li r12,-48 - lvx v29,r12,r0 -.globl _restvr_30 -_restvr_30: - li r12,-32 - lvx v30,r12,r0 -.globl _restvr_31 -_restvr_31: - li r12,-16 - lvx v31,r12,r0 - blr - -#endif /* CONFIG_ALTIVEC */ - -#endif /* CONFIG_PPC64 */ - #endif
The powerpc64 linker generates fpr save/restore functions on-demand, placing them in the .sfpr section. So remove the explicitly coded ones from the 64 build. Have 32-bit put save/restore functions into .sfpr section rather than .text, to match 64-bit. And explicitly have the linker script place the section rather than leaving it as orphan. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- I tested this with 64-bit optimize-for-size build with modules, and that works okay. 32-bit optimize-for-size builds. This should go ahead of the linker-orphan-sections patch, and that patch should no longer add .sfpr section. Thanks, Nick arch/powerpc/Makefile | 2 + arch/powerpc/boot/Makefile | 3 +- arch/powerpc/boot/crtsavres.S | 3 +- arch/powerpc/kernel/vmlinux.lds.S | 6 + arch/powerpc/lib/Makefile | 5 +- arch/powerpc/lib/crtsavres.S | 238 +------------------------------------- 6 files changed, 16 insertions(+), 241 deletions(-)