This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld sig11 while compiling asmutils-0.14 on RedHat-7.1
- To: dmitry dot antipov at auriga dot ru, jules at earthcorp dot com
- Subject: Re: ld sig11 while compiling asmutils-0.14 on RedHat-7.1
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Wed, 25 Apr 2001 23:52:50 -0700
- Cc: binutils at sources dot redhat dot com
- References: <3AE7C160.4729F69@auriga.ru>
On Thu, Apr 26, 2001 at 10:34:08AM +0400, dmitry.antipov@auriga.ru wrote:
> Hello,
>
> I'm trying to compile asmutils-0.14 (the set of system utilities
> written in x86 asm - see http://www.linuxassembly.org/asmutils.html
> for details) and got the fatal error from ld:
>
> [skipped]
>
> gmake[1]: Entering directory
> `/home/antipov/work/stuff/asmutils-0.14/lib'
> nasm -w+orphan-labels -w+macro-params -i../inc/ -g -f elf -D__LINUX__
> -D__OPTIMIZE__=__O_SIZE__ -DDEBUG -D__KERNEL__=24 libc.asm
> libc.asm:155: warning: section attributes ignored on redeclaration of
> section `.text'
> nasm -w+orphan-labels -w+macro-params -i../inc/ -g -f elf -D__LINUX__
> -D__OPTIMIZE__=__O_SIZE__ -DDEBUG -D__KERNEL__=24 libc_stub.asm
> libc_stub.asm:11: warning: section attributes ignored on redeclaration
> of section `.text'
> ar rcv libc.a libc.o
> a - libc.o
> ld -shared -soname ./libc.so.0 \
> -o ./libc.so.0 libc.o
> gmake[1]: *** [libc] Segmentation fault (core dumped)
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/lib/libbfd-2.10.91.0.2.so...
> (no debugging symbols found)...done.
> Loaded symbols for /usr/lib/libbfd-2.10.91.0.2.so
You have 2 problems:
1. nasm 0.98 generates bad ELF binaries.
2. ld in binutils 2.10.91.0.2 dumps core on binaries generated by
nasm 0.98.
The current binutils 2.11.90.0.5 shouldn't dump core. But nasm 0.98
should be fixed. I am also enclosing the nasm patch here.
H.J.
--- nasm-0.98/outelf.c.elf Tue Feb 13 17:14:52 2001
+++ nasm-0.98/outelf.c Tue Feb 13 17:20:17 2001
@@ -922,13 +922,13 @@ static struct SAA *elf_build_symtab (lon
* Now some standard symbols defining the segments, for relocation
* purposes.
*/
- for (i = 1; i <= nsects+1; i++) {
+ for (i = 1; i <= nsects; i++) {
p = entry;
WRITELONG (p, 0); /* no symbol name */
WRITELONG (p, 0); /* offset zero */
WRITELONG (p, 0); /* size zero */
WRITESHORT (p, 3); /* local section-type thing */
- WRITESHORT (p, (i==1 ? SHN_ABS : i-1)); /* the section id */
+ WRITESHORT (p, i); /* the section id */
saa_wbytes (s, entry, 16L);
*len += 16;
(*local)++;