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.1/ld/Makefile.in (+4 lines)
Lines 347-352 ALL_EMULATIONS = \ Link Here
347
	ei386beos.o \
347
	ei386beos.o \
348
	ei386bsd.o \
348
	ei386bsd.o \
349
	ei386coff.o \
349
	ei386coff.o \
350
	ei386freebsd.o \
350
	ei386go32.o \
351
	ei386go32.o \
351
	ei386linux.o \
352
	ei386linux.o \
352
	ei386lynx.o \
353
	ei386lynx.o \
Lines 1711-1716 ei386bsd.c: $(srcdir)/emulparams/i386bsd Link Here
1711
ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
1712
ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
1712
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
1713
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
1713
	${GENSCRIPTS} i386coff "$(tdir_i386coff)"
1714
	${GENSCRIPTS} i386coff "$(tdir_i386coff)"
1715
ei386freebsd.c: $(srcdir)/emulparams/i386freebsd.sh \
1716
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
1717
	${GENSCRIPTS} i386freebsd "$(tdir_i386freebsd)"
1714
ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
1718
ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
1715
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
1719
  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
1716
	${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
1720
	${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
(-)binutils-2.16.1/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.1/ld/emultempl/elf32.em (+71 lines)
Lines 522-527 gld${EMULATION_NAME}_add_sysroot (const Link Here
522
522
523
EOF
523
EOF
524
  case ${target} in
524
  case ${target} in
525
    *-*-freebsd*)
526
      cat >>e${EMULATION_NAME}.c <<EOF
527
/*
528
 * Read the system search path the FreeBSD way rather than like Linux.
529
 */
530
#include <elf-hints.h>
531
532
static bfd_boolean
533
gld${EMULATION_NAME}_check_ld_elf_hints (struct dt_needed *n, int force)
534
{
535
  const char *name = n->name;
536
  static bfd_boolean initialized;
537
  static char *ld_elf_hints;
538
539
  if (! initialized)
540
    {
541
      FILE *f;
542
      char *tmppath;
543
544
      tmppath = concat (ld_sysroot, _PATH_ELF_HINTS, NULL);
545
      f = fopen (tmppath, FOPEN_RB);
546
      free (tmppath);
547
      if (f != NULL)
548
	{
549
	  struct elfhints_hdr hdr;
550
551
	  if (fread(&hdr, 1, sizeof(hdr), f) == sizeof(hdr) &&
552
	      hdr.magic == ELFHINTS_MAGIC &&
553
	      hdr.version == 1)
554
	    {
555
	      if (fseek(f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
556
		{
557
		  char *b;
558
559
		  b = (char *) xmalloc (hdr.dirlistlen + 1);
560
		  if (fread(b, 1, hdr.dirlistlen + 1, f) !=
561
		      hdr.dirlistlen + 1)
562
		    {
563
		      free(b);
564
		      b = NULL;
565
		    }
566
		  else
567
		    {
568
		      ld_elf_hints = gld${EMULATION_NAME}_add_sysroot (b);
569
		      free (b);
570
		    }
571
		}
572
	    }
573
	  fclose (f);
574
	}
575
576
      initialized = TRUE;
577
    }
578
579
  if (ld_elf_hints == NULL)
580
    return FALSE;
581
582
  return gld${EMULATION_NAME}_search_needed (ld_elf_hints, n, force);
583
}
584
EOF
585
    # FreeBSD
586
    ;;
587
525
    *-*-linux-gnu*)
588
    *-*-linux-gnu*)
526
      cat >>e${EMULATION_NAME}.c <<EOF
589
      cat >>e${EMULATION_NAME}.c <<EOF
527
/* For a native linker, check the file /etc/ld.so.conf for directories
590
/* For a native linker, check the file /etc/ld.so.conf for directories
Lines 932-937 cat >>e${EMULATION_NAME}.c <<EOF Link Here
932
EOF
995
EOF
933
if [ "x${USE_LIBPATH}" = xyes ] ; then
996
if [ "x${USE_LIBPATH}" = xyes ] ; then
934
  case ${target} in
997
  case ${target} in
998
    *-*-freebsd*)
999
      cat >>e${EMULATION_NAME}.c <<EOF
1000
	  if (gld${EMULATION_NAME}_check_ld_elf_hints (&n, force))
1001
	    break;
1002
EOF
1003
    # FreeBSD
1004
    ;;
1005
935
    *-*-linux-gnu*)
1006
    *-*-linux-gnu*)
936
      cat >>e${EMULATION_NAME}.c <<EOF
1007
      cat >>e${EMULATION_NAME}.c <<EOF
937
	  if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
1008
	  if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))

Return to bug 123496