You can apply this patch by simply 'patch -p0 < this-file'
This only works with the text version of this document
H.J. Lu
hjl@nynexst.com
12/16/94
This patch contains some necessary bug fixes for binutils 2.5.2 to
support ELF. It is called 2.5.2.6 by me. The fixes may not be the same
as the ones in the next public release of binutils.
H.J.
12/14/94
---
*** ./binutils/Makefile.in.orig Tue Nov 29 11:03:51 1994
--- ./binutils/Makefile.in Wed Dec 14 11:42:03 1994
***************
*** 70,76 ****
LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
# Distribution version
! VERSION=2.5.2
# Distribution name
DIST_NAME=binutils-${VERSION}
--- 70,76 ----
LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
# Distribution version
! VERSION=2.5.2.6
# Distribution name
DIST_NAME=binutils-${VERSION}
*** ./config/mh-linux.orig Mon Nov 28 19:55:59 1994
--- ./config/mh-linux Mon Nov 28 19:56:07 1994
***************
*** 2,8 ****
# FIXME: What is this used for? It should go away (and even if it hasn't,
# it's not clear linux should define it).
SYSV = -DSYSV
! RANLIB = ranlib
# What is this doing here?
#LDFLAGS = -static
--- 2,8 ----
# FIXME: What is this used for? It should go away (and even if it hasn't,
# it's not clear linux should define it).
SYSV = -DSYSV
! #RANLIB = ranlib
# What is this doing here?
#LDFLAGS = -static
*** ./bfd/config/i386linux.mh.orig Mon Nov 28 19:55:18 1994
--- ./bfd/config/i386linux.mh Mon Nov 28 19:55:27 1994
***************
*** 1,4 ****
HDEFINES=-DTRAD_CORE
HDEPFILES=trad-core.o
# Apparently this is needed to build objdump in certain configurations.
! EXTRALIBS=-lm
--- 1,4 ----
HDEFINES=-DTRAD_CORE
HDEPFILES=trad-core.o
# Apparently this is needed to build objdump in certain configurations.
! #EXTRALIBS=-lm
*** ./bfd/bfd-in.h.orig Mon Sep 26 11:01:57 1994
--- ./bfd/bfd-in.h Fri Nov 11 14:30:17 1994
***************
*** 545,555 ****
extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *,
! struct sec **));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *,
! struct sec **));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
/* SunOS shared library support routines for the linker. */
--- 545,555 ----
extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean,
! struct bfd_link_info *, struct sec **));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean,
! struct bfd_link_info *, struct sec **));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
/* SunOS shared library support routines for the linker. */
*** ./bfd/bfd-in2.h.orig Fri Oct 21 21:27:50 1994
--- ./bfd/bfd-in2.h Fri Nov 11 14:30:17 1994
***************
*** 545,555 ****
extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *,
! struct sec **));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, struct bfd_link_info *,
! struct sec **));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
/* SunOS shared library support routines for the linker. */
--- 545,555 ----
extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_elf32_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean,
! struct bfd_link_info *, struct sec **));
extern boolean bfd_elf64_size_dynamic_sections
! PARAMS ((bfd *, const char *, const char *, boolean,
! struct bfd_link_info *, struct sec **));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
/* SunOS shared library support routines for the linker. */
*** ./bfd/elfcode.h.orig Tue Nov 1 17:59:53 1994
--- ./bfd/elfcode.h Sat Dec 10 14:09:19 1994
***************
*** 1845,1851 ****
--- 1845,1858 ----
if (phdr->p_type != PT_NULL
&& (hdr->sh_offset - (phdr->p_offset + phdr->p_memsz)
== hdr->sh_addr - (phdr->p_vaddr + phdr->p_memsz))
+ #if 0
+ /* FIXME: ctors/dtors contain the code, but are r/w. */
+ && (last_type != SHT_NOBITS || hdr->sh_type == SHT_NOBITS)
+ && (((hdr->sh_flags & SHF_WRITE) == 0 && (phdr->p_flags & PF_W) == 0)
+ || ((hdr->sh_flags & SHF_WRITE) != 0 && (phdr->p_flags & PF_W) != 0)))
+ #else
&& (last_type != SHT_NOBITS || hdr->sh_type == SHT_NOBITS))
+ #endif
{
bfd_size_type adjust;
***************
*** 3744,3749 ****
--- 3751,3758 ----
PARAMS ((bfd *, struct bfd_link_info *));
static Elf_Internal_Rela *elf_link_read_relocs
PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean));
+ static boolean elf_export_symbol
+ PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_adjust_dynamic_symbol
PARAMS ((struct elf_link_hash_entry *, PTR));
***************
*** 4863,4873 ****
addresses of the various sections. */
boolean
! NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, info,
! sinterpptr)
bfd *output_bfd;
const char *soname;
const char *rpath;
struct bfd_link_info *info;
asection **sinterpptr;
{
--- 4872,4883 ----
addresses of the various sections. */
boolean
! NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
! export_dynamic, info, sinterpptr)
bfd *output_bfd;
const char *soname;
const char *rpath;
+ boolean export_dynamic;
struct bfd_link_info *info;
asection **sinterpptr;
{
***************
*** 4887,4892 ****
--- 4897,4908 ----
if (dynobj == NULL)
return true;
+ /* If we are supposed to export all symbols into the dynamic symbol
+ table (this is not the normal case), then do so. */
+ if (export_dynamic)
+ elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
+ (PTR) info);
+
if (elf_hash_table (info)->dynamic_sections_created)
{
*sinterpptr = bfd_get_section_by_name (dynobj, ".interp");
***************
*** 5019,5024 ****
--- 5035,5064 ----
return true;
}
+ /* This routine is used to export all defined symbols into the dynamic
+ symbol table. It is called via elf_link_hash_traverse. */
+
+ static boolean
+ elf_export_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+ {
+ struct bfd_link_info *info = (struct bfd_link_info *) data;
+
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR)) != 0)
+ {
+ if (! elf_link_record_dynamic_symbol (info, h))
+ {
+ /* FIXME: No way to report error. */
+ abort ();
+ }
+ }
+
+ return true;
+ }
+
/* Make the backend pick a good value for a dynamic symbol. This is
called via elf_link_hash_traverse, and also calls itself
recursively. */
***************
*** 5202,5207 ****
--- 5242,5248 ----
dynamic = elf_hash_table (info)->dynamic_sections_created;
dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynamic ? dynobj != 0 : dynobj == 0); /* FIXME */
finfo.info = info;
finfo.output_bfd = abfd;
***************
*** 5895,5900 ****
--- 5936,5955 ----
strip = true;
else
strip = false;
+
+ /*
+ * If we are not creating a shared library, complain about any symbols which
+ * are undefined. If we do not do this, the linker will not complain about
+ * unresolved references within shared libraries, and the application might
+ * die at runtime. Only warn about symbols that are referenced in shared libraries
+ * and not in regular .o files - the rest have been warned about already.
+ */
+ if (!finfo->info->shared &&
+ !(h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_DEF_DYNAMIC))
+ && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR | ELF_LINK_HASH_REF_DYNAMIC))
+ == ELF_LINK_HASH_REF_DYNAMIC)
+ (*finfo->info->callbacks->undefined_symbol)
+ (finfo, h->root.root.string, h->root.u.undef.abfd, bfd_und_section_ptr, 0);
/* If we're stripping it, and it's not a dynamic symbol, there's
nothing else to do. */
*** ./bfd/elf32-i386.c.orig Fri Nov 4 10:35:44 1994
--- ./bfd/elf32-i386.c Wed Dec 14 09:26:08 1994
***************
*** 1035,1043 ****
if (h->root.type == bfd_link_hash_defined)
{
sec = h->root.u.def.section;
! relocation = (h->root.u.def.value
! + sec->output_section->vma
! + sec->output_offset);
}
else if (h->root.type == bfd_link_hash_weak)
relocation = 0;
--- 1035,1059 ----
if (h->root.type == bfd_link_hash_defined)
{
sec = h->root.u.def.section;
! if (r_type == R_386_GOTPC
! || (r_type == R_386_PLT32
! && h->plt_offset != (bfd_vma) -1)
! || (r_type == R_386_GOT32
! && elf_hash_table (info)->dynamic_sections_created)
! || (info->shared
! && (r_type == R_386_32
! || r_type == R_386_PC32)
! && (input_section->flags & SEC_ALLOC) != 0))
! {
! /* In these cases, we don't need the relocation
! value. We check specially because in some
! obscure cases sec->output_section will be NULL. */
! relocation = 0;
! }
! else
! relocation = (h->root.u.def.value
! + sec->output_section->vma
! + sec->output_offset);
}
else if (h->root.type == bfd_link_hash_weak)
relocation = 0;
*** ./bfd/i386linux.c.orig Mon Aug 22 11:00:32 1994
--- ./bfd/i386linux.c Tue Nov 29 02:12:59 1994
***************
*** 91,96 ****
--- 91,102 ----
#define PLT_REF_PREFIX "__PLT_"
#endif
+ /* Used to generate specialized error messages */
+
+ #ifndef NEEDS_SHRLIB
+ #define NEEDS_SHRLIB "__NEEDS_SHRLIB_"
+ #endif
+
#define IS_PLT_SYM(name) \
(strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0)
***************
*** 416,423 ****
--- 422,453 ----
struct bfd_link_info *info = (struct bfd_link_info *) data;
struct fixup *f, *f1;
int is_plt;
+ char * missing_filename, *cpnt;
struct linux_link_hash_entry *h1, *h2;
boolean exists;
+
+ if (h->root.root.type == bfd_link_hash_undefined &&
+ strncmp(h->root.root.root.string, NEEDS_SHRLIB, strlen(NEEDS_SHRLIB)) == 0)
+ {
+ missing_filename = strdup(h->root.root.root.string + strlen(NEEDS_SHRLIB));
+ cpnt = strrchr(missing_filename, '_');
+ if (cpnt)
+ {
+ *cpnt = 0;
+ fprintf (stderr,
+ "ld: Output file requires shared library `%s.so.%s'\n",
+ missing_filename, cpnt + 1);
+ }
+ else
+ {
+ fprintf (stderr,
+ "ld: Output file requires shared library `%s'\n",
+ missing_filename);
+ }
+ free(missing_filename);
+
+ abort ();
+ }
/* If this symbol is not a PLT/GOT, we do not even need to look at it */
is_plt = IS_PLT_SYM (h->root.root.root.string);
*** ./gas/config/tc-i386.c.orig Fri Oct 21 21:42:53 1994
--- ./gas/config/tc-i386.c Sun Dec 4 18:15:00 1994
***************
*** 1691,1699 ****
insn_size += size;
#ifdef BFD_ASSEMBLER
if (r_type == BFD_RELOC_32
- && i.imms[n]->X_op == O_symbol
&& GOT_symbol
! && GOT_symbol == i.imms[n]->X_add_symbol)
{
r_type = BFD_RELOC_386_GOTPC;
i.imms[n]->X_add_number += 3;
--- 1691,1701 ----
insn_size += size;
#ifdef BFD_ASSEMBLER
if (r_type == BFD_RELOC_32
&& GOT_symbol
! && GOT_symbol == i.imms[n]->X_add_symbol
! && (i.imms[n]->X_op == O_symbol
! || (i.imms[n]->X_op == O_add
! && i.imms[n]->X_add_symbol -> sy_value.X_op == O_constant)))
{
r_type = BFD_RELOC_386_GOTPC;
i.imms[n]->X_add_number += 3;
***************
*** 2420,2435 ****
if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy)
{
value += fixP->fx_where + fixP->fx_frag->fr_address;
- #ifdef OBJ_ELF
- if (S_GET_SEGMENT (fixP->fx_addsy) != undefined_section)
- {
- /* Yes, we add the values in twice. This is because
- bfd_perform_relocation subtracts them out again. I think
- bfd_perform_relocation is broken, but I don't dare change
- it. FIXME. */
- value += fixP->fx_where + fixP->fx_frag->fr_address;
- }
- #endif
}
/* Fix a few things - the dynamic linker expects certain values here,
--- 2422,2427 ----
*** ./gas/Makefile.in.orig Tue Nov 29 11:03:26 1994
--- ./gas/Makefile.in Wed Dec 14 11:42:10 1994
***************
*** 53,59 ****
includedir = $(prefix)/include
docdir = $(datadir)/doc
! VERSION=2.5.2
SHELL = /bin/sh
--- 53,59 ----
includedir = $(prefix)/include
docdir = $(datadir)/doc
! VERSION=2.5.2.6
SHELL = /bin/sh
*** ./gas/write.c.orig Mon Oct 17 22:12:25 1994
--- ./gas/write.c Fri Nov 11 14:22:41 1994
***************
*** 2271,2276 ****
--- 2271,2290 ----
}
}
+ #ifdef OBJ_ELF
+ if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy)
+ {
+ if (S_GET_SEGMENT (fixP->fx_addsy) == this_segment_type)
+ {
+ /* Yes, we add the values in twice. This is because
+ bfd_perform_relocation subtracts them out again. I think
+ bfd_perform_relocation is broken, but I don't dare change
+ it. FIXME. */
+ add_number += fixP->fx_where + fixP->fx_frag->fr_address;
+ }
+ }
+ #endif
+
if (!fixP->fx_bit_fixP && size > 0)
{
valueT mask = 0;
*** ./libiberty/basename.c.orig Thu Dec 8 15:15:18 1994
--- ./libiberty/basename.c Thu Dec 8 15:16:11 1994
***************
*** 44,50 ****
char *
basename (name)
! char *name;
{
char *base = name;
--- 44,50 ----
char *
basename (name)
! const char *name;
{
char *base = name;
*** ./ld/ldver.c.orig Tue Nov 29 15:37:17 1994
--- ./ld/ldver.c Wed Dec 14 11:42:39 1994
***************
*** 29,35 ****
ldversion (noisy)
int noisy;
{
! fprintf(stdout,"ld version 2.5.2 (with BFD %s)\n", BFD_VERSION);
if (noisy)
{
--- 29,35 ----
ldversion (noisy)
int noisy;
{
! fprintf(stdout,"ld version 2.5.2.6 (with BFD %s)\n", BFD_VERSION);
if (noisy)
{
*** ./ld/emultempl/elf32.em.orig Tue Sep 27 20:07:51 1994
--- ./ld/emultempl/elf32.em Sat Nov 12 16:53:49 1994
***************
*** 125,130 ****
--- 125,131 ----
if (! bfd_elf32_size_dynamic_sections (output_bfd,
command_line.soname,
command_line.rpath,
+ command_line.export_dynamic,
& link_info,
& sinterp))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
***************
*** 206,215 ****
asection *s;
{
lang_output_section_statement_type *place;
! asection *snew, **pps;
lang_statement_list_type *old;
lang_statement_list_type add;
etree_type *address;
const char *secname, *ps;
lang_output_section_statement_type *os;
--- 207,217 ----
asection *s;
{
lang_output_section_statement_type *place;
! asection *snew, **pps, *sec;
lang_statement_list_type *old;
lang_statement_list_type add;
etree_type *address;
+ int has_dynamic;
const char *secname, *ps;
lang_output_section_statement_type *os;
***************
*** 244,249 ****
--- 246,264 ----
return false;
secname = bfd_get_section_name (s->owner, s);
+
+ /* In dynamic images, we cannot have orphaned relocation sections.
+ The .dynamic section will be all wrong, so for now we simply assert
+ this to be the case. The fix is simple - you need to add the relevant
+ relocation sections to the linker script so that they get bunched
+ with the other relocation sections. The .rel.plt must be the last
+ one always, or you get screwed up for other reasons. */
+
+ has_dynamic = 0;
+ for (sec = output_bfd->sections; sec ; sec = sec->next)
+ if(strcmp(sec->name,".dynamic") == 0) has_dynamic = 1;
+
+ ASSERT(strncmp(secname,".rel",4) || !has_dynamic);
/* Create the section in the output file, and put it in the right
place. This shuffling to make the output file look neater, and
*** ./ld/scripttempl/elf.sc.orig Fri Oct 14 19:15:55 1994
--- ./ld/scripttempl/elf.sc Sat Dec 10 00:54:19 1994
***************
*** 2,10 ****
# Unusual variables checked by this code:
# NOP - two byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
! # OTHER_READONLY_SECTIONS - other than .text .init .ctors .rodata ...
# (e.g., .PARISC.milli)
! # OTHER_READWRITE_SECTIONS - other than .data .bss .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
--- 2,10 ----
# Unusual variables checked by this code:
# NOP - two byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
! # OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
# (e.g., .PARISC.milli)
! # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
***************
*** 20,25 ****
--- 20,26 ----
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
#
+ test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test "$LD_FLAG" = "N" && DATA_ADDR=.
***************
*** 29,34 ****
--- 30,36 ----
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+ ENTRY(${ENTRY})
${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+/* Do we need any of these for elf?
***************
*** 59,64 ****
--- 61,70 ----
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
***************
*** 68,86 ****
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
! *(.text)
! }
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
- .ctors ${RELOCATING-0} : { *(.ctors) }
- .dtors ${RELOCATING-0} : { *(.dtors) }
.rodata ${RELOCATING-0} : { *(.rodata) }
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${RELOCATING+${OTHER_READONLY_SECTIONS}}
/* Read-write section, merged into data segment: */
- ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
--- 74,94 ----
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
! *(.text)
! } = ${NOP-0}
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
.rodata ${RELOCATING-0} : { *(.rodata) }
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${RELOCATING+${OTHER_READONLY_SECTIONS}}
+ /* The last page of text may contain the beginning of data
+ * and the first page of data may contain the end of text.
+ * We first align to the page boundary. We then add the shift
+ * due to the extra end of text, but only if necessary. */
+ ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + ((ALIGN(8) + ${MAXPAGESIZE} - ALIGN(${MAXPAGESIZE})) & (${MAXPAGESIZE} - 1));}
/* Read-write section, merged into data segment: */
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
***************
*** 88,93 ****
--- 96,103 ----
${CONSTRUCTING+CONSTRUCTORS}
}
.data1 ${RELOCATING-0} : { *(.data1) }
+ .ctors ${RELOCATING-0} : { *(.ctors) }
+ .dtors ${RELOCATING-0} : { *(.dtors) }
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
.dynamic ${RELOCATING-0} : { *(.dynamic) }
*** ./ld/ld.h.orig Tue Sep 20 17:15:53 1994
--- ./ld/ld.h Fri Nov 11 14:30:37 1994
***************
*** 61,66 ****
--- 61,70 ----
/* Big or little endian as set on command line. */
enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
+
+ /* If true, export all symbols in the dynamic symbol table of an ELF
+ executable. */
+ boolean export_dynamic;
} args_type;
extern args_type command_line;
*** ./ld/lexsup.c.orig Wed Oct 12 16:26:42 1994
--- ./ld/lexsup.c Sat Dec 3 09:49:23 1994
***************
*** 68,74 ****
#define OPTION_DYNAMIC_LINKER (OPTION_DEFSYM + 1)
#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
#define OPTION_EL (OPTION_EB + 1)
! #define OPTION_HELP (OPTION_EL + 1)
#define OPTION_IGNORE (OPTION_HELP + 1)
#define OPTION_MAP (OPTION_IGNORE + 1)
#define OPTION_NO_KEEP_MEMORY (OPTION_MAP + 1)
--- 68,75 ----
#define OPTION_DYNAMIC_LINKER (OPTION_DEFSYM + 1)
#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
#define OPTION_EL (OPTION_EB + 1)
! #define OPTION_EXPORT_DYNAMIC (OPTION_EL + 1)
! #define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1)
#define OPTION_IGNORE (OPTION_HELP + 1)
#define OPTION_MAP (OPTION_IGNORE + 1)
#define OPTION_NO_KEEP_MEMORY (OPTION_MAP + 1)
***************
*** 106,111 ****
--- 107,113 ----
{"EB", no_argument, NULL, OPTION_EB},
{"EL", no_argument, NULL, OPTION_EL},
{"end-group", no_argument, NULL, ')'},
+ {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
{"format", required_argument, NULL, 'b'},
{"help", no_argument, NULL, OPTION_HELP},
{"Map", required_argument, NULL, OPTION_MAP},
***************
*** 205,210 ****
--- 207,215 ----
case OPTION_EL:
command_line.endian = ENDIAN_LITTLE;
break;
+ case OPTION_EXPORT_DYNAMIC:
+ command_line.export_dynamic = true;
+ break;
case 'e':
lang_add_entry (optarg, 1);
break;
***************
*** 373,380 ****
trace_file_tries = true;
break;
case 'v':
- case 'V':
ldversion (0);
version_printed = true;
break;
case OPTION_VERSION:
--- 378,388 ----
trace_file_tries = true;
break;
case 'v':
ldversion (0);
+ version_printed = true;
+ break;
+ case 'V':
+ ldversion (1);
version_printed = true;
break;
case OPTION_VERSION:
*** ./ld/ldlang.c.orig Tue Sep 20 17:15:58 1994
--- ./ld/ldlang.c Sat Nov 12 12:15:38 1994
***************
*** 2106,2112 ****
lang_finish ()
{
struct bfd_link_hash_entry *h;
! boolean warn = link_info.relocateable ? false : true;
if (entry_symbol == (char *) NULL)
{
--- 2106,2112 ----
lang_finish ()
{
struct bfd_link_hash_entry *h;
! boolean warn = (link_info.relocateable || link_info.shared) ? false : true;
if (entry_symbol == (char *) NULL)
{
*** ./include/libiberty.h.orig Wed Aug 10 16:19:49 1994
--- ./include/libiberty.h Thu Dec 8 15:18:00 1994
***************
*** 23,29 ****
/* Return the last component of a path name. */
! extern char *basename PARAMS ((char *));
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
--- 23,29 ----
/* Return the last component of a path name. */
! extern char *basename PARAMS ((const char *));
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter