aboutsummaryrefslogtreecommitdiff
path: root/bfd/pdp11.c
diff options
context:
space:
mode:
authorStephen Casner <casner@acm.org>2020-04-20 12:49:50 +0100
committerNick Clifton <nickc@redhat.com>2020-04-20 12:49:50 +0100
commit23c8270e9dc60bb78c1800b7deedc117efdb9e92 (patch)
treeeef82324bea47060d20bdfc2377f8a7cc7ff3c24 /bfd/pdp11.c
parentc2e5c986b3825c16a578e5bf84aa412eec276dc7 (diff)
downloadbinutils-23c8270e9dc60bb78c1800b7deedc117efdb9e92.zip
binutils-23c8270e9dc60bb78c1800b7deedc117efdb9e92.tar.gz
binutils-23c8270e9dc60bb78c1800b7deedc117efdb9e92.tar.bz2
When bfd/pdp11.c was copied from bfd/aoutx.h, the #defines for external symbol types N_TEXT etc. were #undef'd and then #define'd with new values. But N_STAB was not changed even though the new value for N_EXT overlapped with it. This caused aout_link_write_symbols() to treat global symbols referenced in the source but defined in a linker script as undefined.
Separately, in translate_symbol_table() the 16-bit symbol values were sign extended to unsigned long (e.g., 64 bits) when they really should be treated as unsigned so the value remains 16 bits. PR 25828 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT causing globals from linker script to be treated as debug symbols. (translate_symbol_table): Don't sign-extend symbol values from 16 to 64 bits in nm output.
Diffstat (limited to 'bfd/pdp11.c')
-rw-r--r--bfd/pdp11.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index 1f8c406..5ad9523 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -160,6 +160,7 @@ static bfd_boolean MY(write_object_contents) (bfd *);
#undef N_REG
#undef N_FN
#undef N_EXT
+#undef N_STAB
#define N_TYPE 0x1f /* Type mask. */
#define N_UNDF 0x00 /* Undefined. */
#define N_ABS 0x01 /* Absolute. */
@@ -169,6 +170,7 @@ static bfd_boolean MY(write_object_contents) (bfd *);
#define N_REG 0x14 /* Register symbol. */
#define N_FN 0x1f /* File name. */
#define N_EXT 0x20 /* External flag. */
+#define N_STAB 0xc0 /* Not relevant; modified aout64.h's 0xe0 to avoid N_EXT. */
#define RELOC_SIZE 2
@@ -1501,7 +1503,7 @@ NAME (aout, translate_symbol_table) (bfd *abfd,
else
return FALSE;
- in->symbol.value = GET_SWORD (abfd, ext->e_value);
+ in->symbol.value = GET_WORD (abfd, ext->e_value);
/* TODO: is 0 a safe value here? */
in->desc = 0;
in->other = 0;