+2002-12-15 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from mainline:
+ 2002-11-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+ * elf32-sh.c (sh_elf_relocate_section): Don't complain about
+ unresolved debugging relocs in dynamic applications.
+ * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
+
+2002-12-10 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
+ read-only section that lies after .text and before .data to be
+ written into the output file and included in a_text.
+ (translate_to_native_sym_flags): If an otherwise unrepresentable
+ section was merged with .text, convert its symbols to N_TEXT
+ symbols.
+ * libaout.h (aout_section_merge_with_text_p): New macro.
+
+2002-12-04 Andreas Schwab <schwab@suse.de>
+
+ * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
+ member.
+ (elf_m68k_link_hash_table_create): Initialize it.
+ (elf_m68k_check_relocs): Handle symbols that are forced to be
+ local due to visibility changes.
+ (elf_m68k_adjust_dynamic_symbol): Likewise.
+ (elf_m68k_size_dynamic_sections): Likewise.
+ (elf_m68k_discard_copies): Likewise.
+ (elf_m68k_relocate_section): Likewise.
+
2002-12-04 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (edit_opd): Correct typo.
if (section != obj_textsec (abfd)
&& section != obj_datasec (abfd))
{
- (*_bfd_error_handler)
- (_("%s: can not represent section `%s' in a.out object file format"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
- bfd_set_error (bfd_error_nonrepresentable_section);
- return false;
+ if (aout_section_merge_with_text_p (abfd, section))
+ section->filepos = obj_textsec (abfd)->filepos +
+ (section->vma - obj_textsec (abfd)->vma);
+ else
+ {
+ (*_bfd_error_handler)
+ (_("%s: can not represent section `%s' in a.out object file format"),
+ bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
+ bfd_set_error (bfd_error_nonrepresentable_section);
+ return false;
+ }
}
if (count != 0)
sym_pointer->e_type[0] = N_UNDF | N_EXT;
else
{
- (*_bfd_error_handler)
- (_("%s: can not represent section `%s' in a.out object file format"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
- bfd_set_error (bfd_error_nonrepresentable_section);
- return false;
+ if (aout_section_merge_with_text_p (abfd, sec))
+ sym_pointer->e_type[0] |= N_TEXT;
+ else
+ {
+ (*_bfd_error_handler)
+ (_("%s: can not represent section `%s' in a.out object file format"),
+ bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
+ bfd_set_error (bfd_error_nonrepresentable_section);
+ return false;
+ }
}
/* Turn the symbol from section relative to absolute again */
struct elf_m68k_link_hash_table
{
struct elf_link_hash_table root;
+
+ /* Small local sym to section mapping cache. */
+ struct sym_sec_cache sym_sec;
};
/* Declare this now that the above structures are defined. */
return NULL;
}
+ ret->sym_sec.abfd = NULL;
+
return &ret->root.root;
}
if (h->got.refcount == 0)
{
/* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
if (!bfd_elf32_link_record_dynamic_symbol (info, h))
return false;
}
/* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
if (!bfd_elf32_link_record_dynamic_symbol (info, h))
return false;
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (!info->symbolic
+ || h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
{
sreloc->_raw_size += sizeof (Elf32_External_Rela);
- /* If we are linking with -Bsymbolic, we count the number of
- PC relative relocations we have entered for this symbol,
- so that we can discard them again if the symbol is later
- defined by a regular object. Note that this function is
- only called if we are using an m68kelf linker hash table,
- which means that h is really a pointer to an
+ /* We count the number of PC relative relocations we have
+ entered for this symbol, so that we can discard them
+ again if, in the -Bsymbolic case, the symbol is later
+ defined by a regular object, or, in the normal shared
+ case, the symbol is forced to be local. Note that this
+ function is only called if we are using an m68kelf linker
+ hash table, which means that h is really a pointer to an
elf_m68k_link_hash_entry. */
- if ((ELF32_R_TYPE (rel->r_info) == R_68K_PC8
- || ELF32_R_TYPE (rel->r_info) == R_68K_PC16
- || ELF32_R_TYPE (rel->r_info) == R_68K_PC32)
- && info->symbolic)
+ if (ELF32_R_TYPE (rel->r_info) == R_68K_PC8
+ || ELF32_R_TYPE (rel->r_info) == R_68K_PC16
+ || ELF32_R_TYPE (rel->r_info) == R_68K_PC32)
{
- struct elf_m68k_link_hash_entry *eh;
struct elf_m68k_pcrel_relocs_copied *p;
+ struct elf_m68k_pcrel_relocs_copied **head;
- eh = (struct elf_m68k_link_hash_entry *) h;
+ if (h != NULL)
+ {
+ struct elf_m68k_link_hash_entry *eh
+ = (struct elf_m68k_link_hash_entry *) h;
+ head = &eh->pcrel_relocs_copied;
+ }
+ else
+ {
+ asection *s;
+ s = (bfd_section_from_r_symndx
+ (abfd, &elf_m68k_hash_table (info)->sym_sec,
+ sec, r_symndx));
+ if (s == NULL)
+ return false;
+
+ head = ((struct elf_m68k_pcrel_relocs_copied **)
+ &elf_section_data (s)->local_dynrel);
+ }
- for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
+ for (p = *head; p != NULL; p = p->next)
if (p->section == sreloc)
break;
bfd_alloc (dynobj, (bfd_size_type) sizeof *p));
if (p == NULL)
return false;
- p->next = eh->pcrel_relocs_copied;
- eh->pcrel_relocs_copied = p;
+ p->next = *head;
+ *head = p;
p->section = sreloc;
p->count = 0;
}
}
/* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
{
if (! bfd_elf32_link_record_dynamic_symbol (info, h))
return false;
s->_raw_size = 0;
}
- /* If this is a -Bsymbolic shared link, then we need to discard all PC
- relative relocs against symbols defined in a regular object. We
- allocated space for them in the check_relocs routine, but we will not
- fill them in in the relocate_section routine. */
- if (info->shared && info->symbolic)
+ /* If this is a -Bsymbolic shared link, then we need to discard all
+ PC relative relocs against symbols defined in a regular object.
+ For the normal shared case we discard the PC relative relocs
+ against symbols that have become local due to visibility changes.
+ We allocated space for them in the check_relocs routine, but we
+ will not fill them in in the relocate_section routine. */
+ if (info->shared)
elf_m68k_link_hash_traverse (elf_m68k_hash_table (info),
elf_m68k_discard_copies,
- (PTR) NULL);
+ (PTR) info);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
}
/* This function is called via elf_m68k_link_hash_traverse if we are
- creating a shared object with -Bsymbolic. It discards the space
- allocated to copy PC relative relocs against symbols which are defined
- in regular objects. We allocated space for them in the check_relocs
- routine, but we won't fill them in in the relocate_section routine. */
+ creating a shared object. In the -Bsymbolic case it discards the
+ space allocated to copy PC relative relocs against symbols which
+ are defined in regular objects. For the normal shared case, if
+ discards space for pc-relative relocs that have become local due to
+ symbol visibility changes. We allocated space for them in the
+ check_relocs routine, but we won't fill them in in the
+ relocate_section routine. */
static boolean
-elf_m68k_discard_copies (h, ignore)
+elf_m68k_discard_copies (h, inf)
struct elf_m68k_link_hash_entry *h;
- PTR ignore ATTRIBUTE_UNUSED;
+ PTR inf;
{
+ struct bfd_link_info *info = (struct bfd_link_info *) inf;
struct elf_m68k_pcrel_relocs_copied *s;
if (h->root.root.type == bfd_link_hash_warning)
h = (struct elf_m68k_link_hash_entry *) h->root.root.u.i.link;
- /* We only discard relocs for symbols defined in a regular object. */
- if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ || (!info->symbolic
+ && (h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
return true;
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
case R_68K_PC8:
case R_68K_PC16:
case R_68K_PC32:
- if (h == NULL)
+ if (h == NULL
+ || (info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
break;
/* Fall through. */
case R_68K_8:
with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING
+ sections because such sections are not SEC_ALLOC and
+ thus ld.so will not process them. */
+ || (sec->output_section == NULL
+ && ((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
relocation = 0;
else if (sec->output_section == NULL)
{
sections against symbols defined externally
in shared libraries. We can't do anything
with them here. */
- || (input_section->flags & SEC_DEBUGGING) != 0)))
+ || (input_section->flags & SEC_DEBUGGING) != 0))
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING
+ sections because such sections are not SEC_ALLOC and
+ thus ld.so will not process them. */
+ || (sec->output_section == NULL
+ && ((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
relocation = 0;
else if (sec->output_section == NULL)
{
}
#endif
+/* Test if a read-only section can be merged with .text. This is
+ possible if:
+
+ 1. Section has file contents and is read-only.
+ 2. The VMA of the section is after the end of .text and before
+ the start of .data.
+ 3. The image is demand-pageable (otherwise, a_text in the header
+ will not reflect the gap between .text and .data). */
+
+#define aout_section_merge_with_text_p(abfd, sec) \
+ (((sec)->flags & (SEC_HAS_CONTENTS|SEC_READONLY)) == \
+ (SEC_HAS_CONTENTS|SEC_READONLY) \
+ && obj_textsec (abfd) != NULL \
+ && obj_datasec (abfd) != NULL \
+ && (sec)->vma >= (obj_textsec (abfd)->vma + \
+ obj_textsec (abfd)->_cooked_size) \
+ && ((sec)->vma + (sec)->_cooked_size) <= obj_datasec (abfd)->vma \
+ && ((abfd)->flags & D_PAGED) != 0)
+
#endif /* ! defined (LIBAOUT_H) */
+2002-11-23 Nick Clifton <nickc@redhat.com>
+
+ * size.c (usage): Fix typo describing switch for hex format.
+
2002-11-07 Nick Clifton <nickc@redhat.com>
* configure.in (LINGUAS): Add 'da'.
fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
fprintf (stream, _(" The options are:\n\
-A|-B --format={sysv|berkeley} Select output style (default is %s)\n\
- -o|-d|-h --radix={8|10|16} Display numbers in octal, decimal or hex\n\
+ -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
-t --totals Display the total sizes (Berkeley only)\n\
--target=<bfdname> Set the binary file format\n\
-h --help Display this information\n\
+2002-11-30 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * config/tc-sh.c (md_apply_fix3): Take account of fx_offset
+ for BFD_RELOC_32_PLT_PCREL.
+
2002-11-20 Alan Modra <amodra@bigpond.net.au>
* write.c (adjust_reloc_syms): Don't reduce SEC_MERGE fixups with
/* Make the jump instruction point to the address of the operand. At
runtime we merely add the offset to the actual PLT entry. */
* valP = 0xfffffffc;
- val = fixP->fx_addnumber;
+ val = fixP->fx_addnumber + fixP->fx_offset;
if (fixP->fx_subsy)
val -= S_GET_VALUE (fixP->fx_subsy);
md_number_to_chars (buf, val, 4);
+2002-11-30 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sh/gas/sh/pic.s: Add a test for ".long foo@PLT+.-2-label".
+ * sh/gas/sh/pic.d: Add expected output.
+
2002-10-28 Daniel Jacobowitz <drow@mvista.com>
Merge from mainline:
0x00000040 00 00 \.word 0x0000
40: R_SH_PLT32 foo
0x00000042 00 14 mov\.b r1,@\(r0,r0\)
+0x00000044 00 00 \.word 0x0000
+ 44: R_SH_PLT32 foo
+0x00000046 00 1e mov\.l @\(r0,r1\),r0
.long foo@PLT + . - (.LPLTcall_old + 2)
.Lfooplt_new:
.long foo@PLT - (.LPLTcall_new + 2 - .)
+.Lfooplt_old2:
+ .long foo@PLT + . - 2 - .LPLTcall_old
+2002-12-02 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (LINGUAS): Add pt_BR.
+ * configure: Regenerate.
+ * po/pt_BR: New Brazillian Portugese translation.
+
+2002-11-12 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (ALL_LINGUAS): Add da.
+ * configure: Regenerate.
+ * po/da.po: New Danish translation.
+
2002-10-30 Daniel Jacobowitz <drow@mvista.com>
* po/gprof.pot: Regenerated.
done
-ALL_LINGUAS="fr tr sv es id"
+ALL_LINGUAS="fr tr sv es id da pt_BR"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2497: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
AC_CHECK_FUNCS(setmode)
-ALL_LINGUAS="fr tr sv es id"
+ALL_LINGUAS="fr tr sv es id da pt_BR"
CY_GNU_GETTEXT
AM_MAINTAINER_MODE
+2002-12-10 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (struct orphan_save): Add os_tail field.
+ (gld${EMULATION_NAME}_place_orphan): Re-order output_section_statement
+ list too.
+
+2002-12-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Set
+ load_base for orphans that follow a section with load_base set.
+
+2002-12-01 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Remove the extra `;' in sample version script.
+
2002-11-27 David O'Brien <obrien@FreeBSD.org>
* configure.host: Fix generic FreeBSD configuration entry.
lang_output_section_statement_type *os;
asection **section;
lang_statement_union_type **stmt;
+ lang_statement_union_type **os_tail;
};
static boolean
const char *secname;
const char *ps = NULL;
lang_output_section_statement_type *os;
+ lang_statement_union_type **os_tail;
+ etree_type *load_base;
int isdyn = 0;
secname = bfd_get_section_name (s->owner, s);
}
}
+ address = NULL;
if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
- else
- address = NULL;
+ load_base = NULL;
+ if (place != NULL && place->os->load_base != NULL)
+ {
+ etree_type *lma_from_vma;
+ lma_from_vma = exp_binop ('-', place->os->load_base,
+ exp_nameop (ADDR, place->os->name));
+ load_base = exp_binop ('+', lma_from_vma,
+ exp_nameop (ADDR, secname));
+ }
+
+ os_tail = lang_output_section_statement.tail;
os = lang_enter_output_section_statement (secname, address, 0,
(bfd_vma) 0,
(etree_type *) NULL,
(etree_type *) NULL,
- (etree_type *) NULL);
+ load_base);
lang_add_section (&os->children, s, os, file);
read/write section before or amongst the read-only ones. */
if (add.head != NULL)
{
+ lang_statement_union_type *newly_added_os;
+
if (place->stmt == NULL)
{
/* Put the new statement list right at the head. */
*add.tail = place->os->header.next;
place->os->header.next = add.head;
+
+ place->os_tail = &place->os->next;
}
else
{
/* Save the end of this list. */
place->stmt = add.tail;
+
+ /* Do the same for the list of output statements. */
+ newly_added_os = *os_tail;
+ *os_tail = NULL;
+ newly_added_os->output_section_statement.next = *place->os_tail;
+ *place->os_tail = newly_added_os;
+ place->os_tail = &newly_added_os->output_section_statement.next;
+
+ /* Fixing the global list pointer here is a little different.
+ We added to the list in lang_enter_output_section_statement,
+ trimmed off the new output_section_statment above when
+ assigning *os_tail = NULL, but possibly added it back in
+ the same place when assigning *place->os_tail. */
+ if (*os_tail == NULL)
+ lang_output_section_statement.tail = os_tail;
}
}
When the linker finds a symbol defined in a library which is not
specifically bound to a version node, it will effectively bind it to an
unspecified base version of the library. You can bind all otherwise
-unspecified symbols to a given version node by using @samp{global: *}
+unspecified symbols to a given version node by using @samp{global: *;}
somewhere in the version script.
The names of the version nodes have no specific meaning other than what
won't.
@smallexample
-@{ global: foo; bar; local: *; @}
+@{ global: foo; bar; local: *; @};
@end smallexample
When you link an application against a shared library that has versioned
+2002-11-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * ld-sh/refdbg-0-dso.d: New test.
+ * ld-sh/refdbg-1.d: Likewise.
+ * ld-sh/refdbg.s: Likewise.
+ * ld-sh/refdbglib.s: Likewise.
+
2002-11-13 Alan Modra <amodra@bigpond.net.au>
Merge from mainline: