When bfd/pdp11.c was copied from bfd/aoutx.h, the #defines for external symbol types...
authorStephen Casner <casner@acm.org>
Mon, 20 Apr 2020 11:49:50 +0000 (12:49 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 20 Apr 2020 11:49:50 +0000 (12:49 +0100)
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.

bfd/ChangeLog
bfd/pdp11.c

index f88e8831828e7112cac8bd9ea0ef8f3ab1c27c63..76f563094cedad4697185d01ced2fa8f92873683 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-20  Stephen Casner  <casner@acm.org>
+
+       * 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.
+
 2020-04-20  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
index 1f8c4061e9942df40bb4f552dbf5262f0b11cae3..5ad95236590ea951a916d8cb14fd5fc7207f2724 100644 (file)
@@ -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;
This page took 0.028302 seconds and 4 git commands to generate.