bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/25569] New: PDP11 ld -s clobbers last data byte


From: casner at acm dot org
Subject: [Bug ld/25569] New: PDP11 ld -s clobbers last data byte
Date: Mon, 17 Feb 2020 21:04:44 +0000

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

            Bug ID: 25569
           Summary: PDP11 ld -s clobbers last data byte
           Product: binutils
           Version: 2.35 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: casner at acm dot org
  Target Milestone: ---

Created attachment 12294
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12294&action=edit
Proposed patch

When the -s option is supplied to ld for pdp11-aout target to suppress writing
the symbol table, the last byte of the .data section is overwritten with 0. 
There is code explicitly written to do this near the end of the final_link
function in bfd/pdp11.c. It appears that the intention of that code was to pad
with 0 for a .data section of odd length, but the last data byte is overwritten
when the length is even.  Furthermore, in normal usage the length is always
even because gas pads the .data section in an object file if it is odd.

For testing, and odd-length .data section can be forced with a linker script
that appends one byte.

I am attaching a proposed fix that checks for the file length being odd using
the bfd->where member and only appends the 0 pad byte in that case.

-- 
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]