This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Segfault with -pie on IA64
- From: Ian Wienand <ianw at gelato dot unsw dot edu dot au>
- To: binutils at sources dot redhat dot com
- Date: Fri, 31 Oct 2003 15:46:37 +1100
- Subject: Segfault with -pie on IA64
Hi,
Try
echo "int main(void) { return 1; }" > test.c
gcc -c test.c
ld -pie -o test test.o `gcc --print-file-name crtbegin.o`
Segmentation fault
I have a feeling this is a gcc bug, but I thought I would run it by
here first. The problem is essentially that set_fptr_entry() is
getting an invalid pointer to 'info' from
elf64_ia64_relocate_section().
The code that passes that pointer (in bfd/elf64-ia64.c) looks fine to
me, but maybe I am missing something. See the stack trace below.
Any thoughts?
#0 bfd_putl64 (data=67408, addr=0x0) at libbfd.c:649
#1 0x40000000000684e0 in bfd_elf64_swap_reloca_out
(abfd=0x6000000000026f30, src=0x60000fffffffbad0, d=0x0) at
elfcode.h:434
#2 0x4000000000062970 in set_fptr_entry (abfd=0x6000000000026f20,
info=0x6000000000029440, dyn_i=0x6000000000050f60, value=1504) at
elf64-ia64.c:3464
#3 0x4000000000064560 in elf64_ia64_relocate_section
(output_bfd=0x6000000000026f20, info=0x60000000000170c0,
input_bfd=0x6000000000052660, input_section=0x6000000000055280,
contents=0x6000000000054570 "", relocs=0x600000000005e4d8,
local_syms=0x6000000000073eb0, local_sections=0x60000000000545b0)
at elf64-ia64.c:3786
#4 0x400000000007b940 in elf_link_input_bfd (finfo=0x60000fffffffbb20,
input_bfd=0x6000000000052660) at elflink.h:4681
#5 0x40000000000782c0 in bfd_elf64_bfd_final_link
(abfd=0x6000000000026f20, info=0x60000000000170c0) at elflink.h:3091
#6 0x4000000000063500 in elf64_ia64_final_link
(abfd=0x6000000000026f20, info=0x60000000000170c0) at
elf64-ia64.c:3708
#7 0x4000000000029540 in ldwrite () at ldwrite.c:556
#8 0x4000000000023eb0 in main (argc=74888, argv=0x60000fffffffbc48) at
ldmain.c:474
-i
ianw@gelato.unsw.edu.au
http://www.gelato.unsw.edu.au