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

--- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-6 simple]$ 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];
}
[hjl@gnu-6 simple]$ 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];
}
[hjl@gnu-6 simple]$ make
gcc -m32 -fPIC -O2   -c -o z.o z.c
gcc -m32 -fPIC -O2   -c -o x.o x.c
../ld -shared -m elf_i386  -o x.so x.o
../ld -pie -m elf_i386  -o z z.o x.so
../ld: BFD (GNU Binutils) 2.26.51.20151201 assertion fail
/export/gnu/import/git/sources/binutils-gdb/bfd/elf32-i386.c:5297
Makefile:11: recipe for target 'z' failed
make: *** [z] Error 1
[hjl@gnu-6 simple]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to