* Re: problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol [not found] <CAHEkXCQ5HeiSmSkFSh5bLvo-VO225bKugDXYVFp34-zbb3uriA@mail.gmail.com> @ 2011-11-13 0:43 ` Michael Cree 2011-12-06 16:46 ` Raúl Porcel 0 siblings, 1 reply; 4+ messages in thread From: Michael Cree @ 2011-11-13 0:43 UTC (permalink / raw) To: carl hansen; +Cc: debian-alpha, linux-alpha [Added linux-alpha to CC to increase likelihood of reaching someone who best knows about this issue.] On 03/11/11 15:54, carl hansen wrote: > Problem compiling kernel 3.1, gcc 4.6.1 or .2, latest binutils > > I think it's ld error > google suggested -Wl,--no-relax, didn't make a difference, unless I > did it wrong The binutils bug that can be worked around with --no-relax is not the issue here. > ld -static -N --build-id -o .tmp_vmlinux1 -T > arch/alpha/kernel/vmlinux.lds arch/alpha/kernel/head.o > init/built-in.o --start-group usr/built-in.o > arch/alpha/kernel/built-in.o arch/alpha/mm/built-in.o > arch/alpha/math-emu/built-in.o kernel/built-in.o mm/built-in.o > fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o > block/built-in.o lib/lib.a arch/alpha/lib/lib.a lib/built-in.o > arch/alpha/lib/built-in.o drivers/built-in.o sound/built-in.o > firmware/built-in.o net/built-in.o --end-group > init/built-in.o: In function `do_one_initcall': > /var/src.build/kernelbuild/latest/linux-3.1/init/main.c:682:(.text+0x8): > relocation truncated to fit: GPREL16 against symbol `initcall_debug' > defined in .sbss section in init/built-in.o Confirmed. Building kernel 3.1 with config for Miata and mainly only drivers needed for that hardware compiles fine with gcc-4.4 but fails with the GPREL16 link errors when compiled with gcc-4.6. If I modify arch/kernel/Makefile to add -mlarge-data rather than -msmall-data to CFLAGS then the kernel successfully compiles with gcc-4.6. Is there anyone more knowledgeable than I about gcc who can give us guidance as to why gcc-4.6 should be enlarging the data segment so much that the small data model cannot be used? Or is there a fix required in the kernel code? Cheers Michael. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol 2011-11-13 0:43 ` problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol Michael Cree @ 2011-12-06 16:46 ` Raúl Porcel 2011-12-06 18:55 ` Uros Bizjak 0 siblings, 1 reply; 4+ messages in thread From: Raúl Porcel @ 2011-12-06 16:46 UTC (permalink / raw) To: Michael Cree; +Cc: carl hansen, debian-alpha, linux-alpha, Uros Bizjak On 11/13/2011 01:43 AM, Michael Cree wrote: [snip] > > Is there anyone more knowledgeable than I about gcc who can give us > guidance as to why gcc-4.6 should be enlarging the data segment so much > that the small data model cannot be used? Or is there a fix required in > the kernel code? Guess Uros can help here... ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol 2011-12-06 16:46 ` Raúl Porcel @ 2011-12-06 18:55 ` Uros Bizjak 2011-12-06 22:27 ` Michael Cree 0 siblings, 1 reply; 4+ messages in thread From: Uros Bizjak @ 2011-12-06 18:55 UTC (permalink / raw) To: Raúl Porcel Cc: Michael Cree, carl hansen, debian-alpha, linux-alpha, Richard Henderson On Tue, Dec 6, 2011 at 5:46 PM, Raúl Porcel <armin76@gentoo.org> wrote: > On 11/13/2011 01:43 AM, Michael Cree wrote: > [snip] >> >> Is there anyone more knowledgeable than I about gcc who can give us >> guidance as to why gcc-4.6 should be enlarging the data segment so much >> that the small data model cannot be used? Or is there a fix required in >> the kernel code? > > Guess Uros can help here... Unfortunately, I have no idea... There are similar problems with gcc build, so I use: # Prevent GPREL16 relocation truncation LDFLAGS += -Wl,--no-relax BOOT_LDFLAGS += -Wl,--no-relax to finish the bootstrap. IMO, this points to linker problems. Perhaps rth (CC'd) can say something about this problem. Uros. -- To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol 2011-12-06 18:55 ` Uros Bizjak @ 2011-12-06 22:27 ` Michael Cree 0 siblings, 0 replies; 4+ messages in thread From: Michael Cree @ 2011-12-06 22:27 UTC (permalink / raw) To: Uros Bizjak Cc: Raúl Porcel, carl hansen, debian-alpha, linux-alpha, Richard Henderson On 7/12/2011, at 7:55 AM, Uros Bizjak wrote: > On Tue, Dec 6, 2011 at 5:46 PM, Raúl Porcel <armin76@gentoo.org> > wrote: >> On 11/13/2011 01:43 AM, Michael Cree wrote: >> [snip] >>> >>> Is there anyone more knowledgeable than I about gcc who can give us >>> guidance as to why gcc-4.6 should be enlarging the data segment so >>> much >>> that the small data model cannot be used? Or is there a fix >>> required in >>> the kernel code? >> >> Guess Uros can help here... > > Unfortunately, I have no idea... There are similar problems with gcc > build, so I use: > > # Prevent GPREL16 relocation truncation > LDFLAGS += -Wl,--no-relax > BOOT_LDFLAGS += -Wl,--no-relax Yeah, there are a growing number of packages being affected by this (presumably linker) problem and I have recently seen it with gcc- snapshot and gnat-4.6 in Debian. However I don't think this is the issue seen with the Linux kernel, which has the --relax argument commented out of the linker flags in the Makefile. What we see is that gcc-4.4 successfully compiles the Linux kernel. Using gcc-4.6 results in relocation errors. The kernel Makefile adds - msmall-data to the compiler flags. If this is change to -mlarge-data then compilation with gcc-4.6 succeeds. What I am wondering about is what is the change in gcc-4.6 that causes the data segment (presumably) to be too large to stored in 64 kbytes (whereas gcc-4.4 can fit it in 64kbytes)? Cheers Michael. -- To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-06 22:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHEkXCQ5HeiSmSkFSh5bLvo-VO225bKugDXYVFp34-zbb3uriA@mail.gmail.com>
2011-11-13 0:43 ` problem compiling kernel ld error relocation truncated to fit: GPREL16 against symbol Michael Cree
2011-12-06 16:46 ` Raúl Porcel
2011-12-06 18:55 ` Uros Bizjak
2011-12-06 22:27 ` Michael Cree
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.