Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 123496 | Differences between
and this patch

Collapse All | Expand All

(-)binutils-2.16.91.0.6/ld/Makefile.in (+4 lines)
Lines 446-451 ALL_EMULATIONS = \ Link Here
446
	ei386beos.o \
446
	ei386beos.o \
447
	ei386bsd.o \
447
	ei386bsd.o \
448
	ei386coff.o \
448
	ei386coff.o \
449
	ei386freebsd.o \
449
	ei386go32.o \
450
	ei386go32.o \
450
	ei386linux.o \
451
	ei386linux.o \
451
	ei386lynx.o \
452
	ei386lynx.o \
Lines 1795-1800 ei386bsd.c: $(srcdir)/emulparams/i386bsd Link Here
1795
ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
1796
ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
1796
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
1797
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
1797
	${GENSCRIPTS} i386coff "$(tdir_i386coff)"
1798
	${GENSCRIPTS} i386coff "$(tdir_i386coff)"
1799
ei386freebsd.c: $(srcdir)/emulparams/i386freebsd.sh \
1800
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
1801
	${GENSCRIPTS} i386freebsd "$(tdir_i386freebsd)"
1798
ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
1802
ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
1799
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
1803
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
1800
	${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
1804
	${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
(-)binutils-2.16.91.0.6/ld/emulparams/i386freebsd.sh (+6 lines)
Line 0 Link Here
1
SCRIPT_NAME=aout
2
TEXT_START_ADDR=0x1020
3
OUTPUT_FORMAT="a.out-i386-freebsd"
4
TARGET_PAGE_SIZE=0x1000
5
ARCH=i386
6
EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
(-)binutils-2.16.91.0.6/ld/emultempl/elf32.em (+71 lines)
Lines 529-534 gld${EMULATION_NAME}_add_sysroot (const Link Here
529
529
530
EOF
530
EOF
531
  case ${target} in
531
  case ${target} in
532
    *-*-freebsd*)
533
      cat >>e${EMULATION_NAME}.c <<EOF
534
/*
535
 * Read the system search path the FreeBSD way rather than like Linux.
536
 */
537
#include <elf-hints.h>
538
539
static bfd_boolean
540
gld${EMULATION_NAME}_check_ld_elf_hints (struct dt_needed *n, int force)
541
{
542
  const char *name = n->name;
543
  static bfd_boolean initialized;
544
  static char *ld_elf_hints;
545
546
  if (! initialized)
547
    {
548
      FILE *f;
549
      char *tmppath;
550
551
      tmppath = concat (ld_sysroot, _PATH_ELF_HINTS, NULL);
552
      f = fopen (tmppath, FOPEN_RB);
553
      free (tmppath);
554
      if (f != NULL)
555
	{
556
	  struct elfhints_hdr hdr;
557
558
	  if (fread(&hdr, 1, sizeof(hdr), f) == sizeof(hdr) &&
559
	      hdr.magic == ELFHINTS_MAGIC &&
560
	      hdr.version == 1)
561
	    {
562
	      if (fseek(f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
563
		{
564
		  char *b;
565
566
		  b = (char *) xmalloc (hdr.dirlistlen + 1);
567
		  if (fread(b, 1, hdr.dirlistlen + 1, f) !=
568
		      hdr.dirlistlen + 1)
569
		    {
570
		      free(b);
571
		      b = NULL;
572
		    }
573
		  else
574
		    {
575
		      ld_elf_hints = gld${EMULATION_NAME}_add_sysroot (b);
576
		      free (b);
577
		    }
578
		}
579
	    }
580
	  fclose (f);
581
	}
582
583
      initialized = TRUE;
584
    }
585
586
  if (ld_elf_hints == NULL)
587
    return FALSE;
588
589
  return gld${EMULATION_NAME}_search_needed (ld_elf_hints, n, force);
590
}
591
EOF
592
    # FreeBSD
593
    ;;
594
532
    *-*-linux-* | *-*-k*bsd*-*)
595
    *-*-linux-* | *-*-k*bsd*-*)
533
      cat >>e${EMULATION_NAME}.c <<EOF
596
      cat >>e${EMULATION_NAME}.c <<EOF
534
/* For a native linker, check the file /etc/ld.so.conf for directories
597
/* For a native linker, check the file /etc/ld.so.conf for directories
Lines 921-926 EOF Link Here
921
fi
984
fi
922
if [ "x${USE_LIBPATH}" = xyes ] ; then
985
if [ "x${USE_LIBPATH}" = xyes ] ; then
923
  case ${target} in
986
  case ${target} in
987
    *-*-freebsd*)
988
      cat >>e${EMULATION_NAME}.c <<EOF
989
	  if (gld${EMULATION_NAME}_check_ld_elf_hints (&n, force))
990
	    break;
991
EOF
992
    # FreeBSD
993
    ;;
994
924
    *-*-linux-* | *-*-k*bsd*-*)
995
    *-*-linux-* | *-*-k*bsd*-*)
925
    # Linux
996
    # Linux
926
      cat >>e${EMULATION_NAME}.c <<EOF
997
      cat >>e${EMULATION_NAME}.c <<EOF

Return to bug 123496