This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[RFA] pdp11.c: Fix link errors
- From: Paul Koning <paul_koning at dell dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 28 Dec 2010 13:34:13 -0500
- Subject: [RFA] pdp11.c: Fix link errors
This patch cures two issues with linking for pdp11:
When the program is larger than 32 kB, you'd get relocation truncated errors because the relocation overflow check was set to "signed", but "unsigned" is appropriate for pdp11.
When linking against libraries with debug symbols you'd sometimes get duplicate definition errors on names that are in fact stabs entries, not globals. This is caused by code that looks for N_BSS|N_EXT entries, but that code point is used for N_FUN instead.
Tested by build for pdp11 target and check of the gcc testcase that caught this.
Ok to commit?
paul
ChangeLog:
* pdp11.c (howto_table_pdp11): Make overflow check unsigned.
(translate_from_native_sym_flags, pdp11_aout_swap_reloc_out,
aout_link_check_ar_symbols, aout_link_add_symbols): Remove case
for N_BSS|N_EXT.
Index: pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.47
diff -u -r1.47 pdp11.c
--- pdp11.c 13 Dec 2010 01:06:15 -0000 1.47
+++ pdp11.c 28 Dec 2010 18:28:51 -0000
@@ -245,8 +245,8 @@
reloc_howto_type howto_table_pdp11[] =
{
/* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
-HOWTO( 0, 0, 1, 16, FALSE, 0, complain_overflow_signed,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
-HOWTO( 1, 0, 1, 16, TRUE, 0, complain_overflow_signed,0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO( 0, 0, 1, 16, FALSE, 0, complain_overflow_unsigned,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO( 1, 0, 1, 16, TRUE, 0, complain_overflow_unsigned,0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
};
#define TABLE_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0]))
@@ -1345,7 +1345,7 @@
cache_ptr->symbol.flags = visible;
break;
- case N_BSS: case N_BSS | N_EXT:
+ case N_BSS:
cache_ptr->symbol.section = obj_bsssec (abfd);
cache_ptr->symbol.value -= cache_ptr->symbol.section->vma;
cache_ptr->symbol.flags = visible;
@@ -1757,7 +1757,6 @@
cache_ptr->addend = ad - su->datasec->vma; \
break; \
case N_BSS: \
- case N_BSS | N_EXT: \
cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; \
cache_ptr->addend = ad - su->bsssec->vma; \
break; \
@@ -2583,7 +2582,6 @@
if (type == (N_TEXT | N_EXT)
|| type == (N_DATA | N_EXT)
- || type == (N_BSS | N_EXT)
|| type == (N_ABS | N_EXT))
{
/* This object file defines this symbol. We must link it
@@ -2822,10 +2820,6 @@
section = obj_datasec (abfd);
value -= bfd_get_section_vma (abfd, section);
break;
- case N_BSS | N_EXT:
- section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
- break;
}
if (! ((*add_one_symbol)