bug-binutils
[Top][All Lists]
Advanced

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

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


From: pkoning at equallogic dot com
Subject: [Bug ld/24144] Gnu ld for PDP-11 is creating corrupt output. NULL inserted in data section.
Date: Fri, 22 Feb 2019 18:34:25 +0000

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

--- Comment #4 from Paul Koning <pkoning at equallogic dot com> ---
Created attachment 11638
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11638&action=edit
Test case object files and script

I ran into this issue some time ago while debugging pdp11-gcc test case
failures.  Here is one.  I extracted the needed object files from the libc
library it uses, included the linker script, and a shell script to build it
showing the failure.

In this one, the bug corrupts a message supposed to be printed by exit().  In
exit.S you can see that status 0 results in message "exit: ok\n".  If you
objdump lib_a-exit.o, you will see that message.

Now link the program using linkbug.sh.  In the objdump of executable "bug", the
message shows up in the objdump .data output for address 1610.  It shows that
"exit" is now "e\000it", i.e., the string is truncated by the spurious zero
byte at the second character.

It appears the issue is not directly related to alignment > 2, because the link
script in this example only has ALIGNED(2) in it.  I suspect the reason it
seemed that way in the original is that changing alignment moves where the
stray 0 lands, and probably for alignment 2 in his example it ended up in some
spot where it does no damage.

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