bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/28903] LD producing SegFault executables with FreePascal 2.6.4,


From: jbthiel at gmail dot com
Subject: [Bug ld/28903] LD producing SegFault executables with FreePascal 2.6.4, in Binutils-2.36.1 and later
Date: Thu, 03 Mar 2022 15:02:35 +0000

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

--- Comment #25 from John B Thiel <jbthiel at gmail dot com> ---
(In reply to Alan Modra from comment #23)
> The segfaults are due to your linker script setting the value of "dot" to
> near zero with ". = 0 +  SIZEOF_HEADERS;" then containing a .data output
> section with additional contents over the standard .data section.  That
> extra .data section then has a vma in the unmapped page at zero (unmapped to
> catch NULL pointer dereferences).  Unsurprisingly you get segfaults in the
> loader.  If the linker uses your script with -T, which seems to be the
> intent, the the whole binary is mapped low.  Segfaults again.
> 

Thanks much Alan, for this info and explanation.

Can you please point out more exactly what line(s) of the link.res are wrong,
and how to correct it?

I had looked at the "fixed link.res" versions HJ Lu attached, but those are not
showing corrections, they just edit the search paths for your local copy of the
object files. And the last one (13989) just deleted all the actual detail
specs, thus it falls back to builtin defaults in LD, I assume.  That might work
for this example helloworld, but it might not for a more complex application. 
Anyways, it doesn't give me any clue what is actually wrong with the link.res
script from FPC.

If you guys absolutely willnot fix this, then I will have to consider extreme
measures like patching the compiler for myself.  So I need to understand
exactly what is the problem line(s), and how to correct it.

The other reference we have is the change FPC team applied in 3.x series, 
which adapted to the recommended -T approach in latest LD versions. (the
commit/4564bffb85e5947cf7bdfa3e2c67bc032775d0c5  I noted above)   
I would hope to avoid understanding/backporting that whole concept, at least to
start. I just want the minimum patch to get this link.res working.


> The linker script is plainly and obviously broken.  Newer linkers are simply
> doing as asked.  Closing, please don't reopen.

Ok, I thought status was changed inadvertently.  It's obviously not resolved or
invalid, binutils/LD 2.36+ doesnt work for FPC 2.6.4, and nothing so far has
given a fix.

You are calling it wontfix, I guess. Which is extremely disappointing, and
pushes the problem to me and other end-user developers.  Deciphering arcane
linker scripts is not my expertise or responsibility.  I have already put in a
substantial effort and contribution in debugging the problem to this point, and
submitting multiple bug reports on multiple sites, and trying to motivate and
explain the severity of this.

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