bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24144] New: Gnu ld for PDP-11 is creating corrupt output. NULL i


From: mattislind at gmail dot com
Subject: [Bug ld/24144] New: Gnu ld for PDP-11 is creating corrupt output. NULL inserted in data section.
Date: Mon, 28 Jan 2019 07:02:24 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24144

            Bug ID: 24144
           Summary: Gnu ld for PDP-11 is creating corrupt output. NULL
                    inserted in data section.
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: mattislind at gmail dot com
  Target Milestone: ---

When linking PDP-11 a.out files the linker seemingly random replaces bytes in
the data section with NULL bytes.

I am having trouble with a very small program in C that is compiled and linked
with PDP-11 GCC. The version is gcc version 9.0.0 20181209 (experimental)
(GCC). The host system is MACOS 10.8.5

GNU LD is version 2.31

The code is located here: https://github.com/MattisLind/pdp11-plot

make -f Makefile.pdp11

The problem is in the main.o file and the resulting testplot.o 

If I do a 
pdp11-aout-objdump  -s main.o > main.objdump

and check the objdump I find the sequence 29 41 7d 29 2b 5c 29 14 40 at
location 23e

023e 2a521f29 417d292b 5c291440 21752621

If I do the same command on testplot.o

pdp11-aout-objdump  -s testplot.o > testplot.objdump

Now at location b20 I get this 

0b20 2a521f29 417d292b 5c001440 21752621

29 has became 00!

I simply cannot understand what is going wrong that could cause it to seemingly
random replace things with 00


Linking command:

testplot.o: crt0.o main.o bresenham.o pdp-xy11.o printf.o divmulmod.o xorhi3.o
ashlhi3.o 
        @pdp11-aout-ld   -T linker-script   -nostartfiles  -nodefaultlibs 
-nostdlib  $^  -o $@

linker-script:

localhost:pdp11-plot mattislind$ cat linker-script 
OUTPUT_FORMAT("a.out-pdp11")
phys = 00000200;
SECTIONS
{
  .text phys : AT(phys) {
    code = .;
    *(.text)
    *(.rodata)
    . = ALIGN(0100);
  }
  .data : AT(phys + (data - code))
  {
    data = .;
    *(.data)
    . = ALIGN(0100);
  }
  .bss : AT(phys + (bss - code))
  {
    bss = .;
    *(.bss)
    . = ALIGN(0100);
  }
  end = .;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]