bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24276] [2.31/2.32 Regression] segfault in elf_x86_64_check_reloc


From: hjl.tools at gmail dot com
Subject: [Bug ld/24276] [2.31/2.32 Regression] segfault in elf_x86_64_check_relocs
Date: Wed, 27 Feb 2019 18:23:16 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24276

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
address@hidden pr24276]$ cat x.c 
int __attribute__((section("my_section"))) a[2] = {0x1234, 0x5678};

extern int __start_my_section;

int
foo ()
{
   int* ap = &__start_my_section;
   return ap[0];
}
address@hidden pr24276]$ cat z.c
int __attribute__((section("my_section"))) a[2] = {0x1234, 0x5678};

extern int __start_my_section;

int
_start ()
{
   int* ap = &__start_my_section;
   return ap[0];
}
address@hidden pr24276]$ make
gcc -fPIC -O2   -c -o z.o z.c
gcc -fPIC -O2   -c -o x.o x.c
ld -shared  -o x.so.1 x.o
echo "INPUT(x.so.1)" > x.so
echo "SECTIONS {" >> x.so
echo "  my_section : {" >> x.so
echo "    __start_my_section = .;" >> x.so
echo "    *(my_section);" >> x.so
echo "    __stop_my_section = .;" >> x.so
echo "" >> x.so
echo "  }" >> x.so
echo "}" >> x.so
ld -shared  -o z.so z.o x.so
ld: warning: x.so contains output sections; did you forget -T?
make: *** [Makefile:14: z.so] Segmentation fault
make: *** Deleting file 'z.so'
address@hidden pr24276]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]