https://sourceware.org/bugzilla/show_bug.cgi?id=30422
Bug ID: 30422 Summary: or1k relocation truncated to fit: R_OR1K_GOT16 even when using -mcmodel=large Product: binutils Version: 2.40 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: gcc at scarsita dot it Target Milestone: --- Created attachment 14863 --> https://sourceware.org/bugzilla/attachment.cgi?id=14863&action=edit Patch to pre-scan the presence of R_OR1K_GOT_AHI16 to detect -mcmodel=large usage While compiling ghostscript shared library with -mcmodel=large on or1k, there is still the GOT overflow error: ./soobj/gxdevndi.o: in function `gx_devn_reduce_colored_halftone': gxdevndi.c:(.text+0x7c): relocation truncated to fit: R_OR1K_GOT16 against symbol `fc_color_quo' defined in .data.rel.ro.local section in ./soobj/gxdevndi.o ./soobj/gxblend.o: in function `art_blend_pixel_8_inline': gxblend.c:(.text+0x1954): relocation truncated to fit: R_OR1K_GOT16 against symbol `art_blend_sq_diff_8' defined in .rodata section in ./soobj/gxblend.o This is because in some case gcc place R_OR1K_GOT_AHI16 *after* R_OR1K_GOT16, so ld does not detected the overflow handling: gxdevndi.o: file format elf32-or1k RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 0000004c R_OR1K_GOTPC_HI16 _GLOBAL_OFFSET_TABLE_-0x00000004 00000050 R_OR1K_GOTPC_LO16 _GLOBAL_OFFSET_TABLE_ 0000007c R_OR1K_GOT16 fc_color_quo 000000dc R_OR1K_GOT_AHI16 fc_color_quo 0000014c R_OR1K_GOT_AHI16 gx_dc_type_pure 0000015c R_OR1K_GOT16 gx_dc_type_pure 00000260 R_OR1K_GOT_AHI16 gx_dc_type_ht_binary 00000270 R_OR1K_GOT16 gx_dc_type_ht_binary 000002d8 R_OR1K_GOT_AHI16 fc_color_quo 000002e8 R_OR1K_GOT16 fc_color_quo [...] gxblend.o: file format elf32-or1k RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 00001530 R_OR1K_GOTPC_HI16 _GLOBAL_OFFSET_TABLE_-0x00000004 00001534 R_OR1K_GOTPC_LO16 _GLOBAL_OFFSET_TABLE_ 000017ac R_OR1K_GOTOFF_AHI16 .rodata.str1.1 000017b8 R_OR1K_PLT26 memcpy 000018f0 R_OR1K_GOTOFF_LO16 .rodata.str1.1 000018f4 R_OR1K_PLT26 dprintf_file_and_line 000018fc R_OR1K_GOTOFF_AHI16 .rodata.str1.1+0x00000011 00001908 R_OR1K_GOTOFF_LO16 .rodata.str1.1+0x00000011 0000190c R_OR1K_PLT26 errprintf_nomem 00001954 R_OR1K_GOT16 art_blend_sq_diff_8 000019ac R_OR1K_GOT_AHI16 art_blend_soft_light_8 000019b0 R_OR1K_GOT_AHI16 art_blend_sq_diff_8 000019d4 R_OR1K_GOT16 art_blend_soft_light_8 [...] One solution could be pre-scanning the presence of R_OR1K_GOT_AHI16, like in the attached patch (tested, and it works). -- You are receiving this mail because: You are on the CC list for the bug.