I'm trying to compile dynamic linker with `gold' linker.
During build with normal ld(1) there is a warning

  cc [...] -elf -o ld-elf.so.1
  LOCALBASE/bin/ld: warning: cannot find entry symbol lf; defaulting to 
00000000000034d0

While it doesn't seem to affect `ld' it does for `gold'. The binary produced
by `gold' segfaults, e.g.

  # from /h...@215110
  Core was generated by `sh'.
  Program terminated with signal 11, Segmentation fault.
  #0  .rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:33
  33              xorq    %rbp,%rbp               # Clear frame pointer for 
good form
  (gdb) bt
  #0  .rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:33
  #1  0x0000000000000001 in ?? ()
  #2  0x00007fffffff0fe0 in ?? ()
  #3  0x0000000000000000 in ?? ()

So, is `-elf' intended or it can be removed?

%%
diff --git a/libexec/rtld-elf/amd64/Makefile.inc 
b/libexec/rtld-elf/amd64/Makefile.inc
index b265a9d..4ecf82f 100644
--- a/libexec/rtld-elf/amd64/Makefile.inc
+++ b/libexec/rtld-elf/amd64/Makefile.inc
@@ -1,7 +1,5 @@
 # $FreeBSD$
 
-CFLAGS+=       -elf
-LDFLAGS+=      -elf
 # Uncomment this to build the dynamic linker as an executable instead
 # of a shared library:
 #LDSCRIPT=     ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/libexec/rtld-elf/i386/Makefile.inc 
b/libexec/rtld-elf/i386/Makefile.inc
index b265a9d..4ecf82f 100644
--- a/libexec/rtld-elf/i386/Makefile.inc
+++ b/libexec/rtld-elf/i386/Makefile.inc
@@ -1,7 +1,5 @@
 # $FreeBSD$
 
-CFLAGS+=       -elf
-LDFLAGS+=      -elf
 # Uncomment this to build the dynamic linker as an executable instead
 # of a shared library:
 #LDSCRIPT=     ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
%%
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to