Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1279626 > unrolled thread

Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack"

Started byEdgar Bonet <linux@edgar-bonet.org>
First post2026-01-24 17:00 +0100
Last post2026-01-25 17:00 +0100
Articles 7 — 2 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Edgar Bonet <linux@edgar-bonet.org> - 2026-01-24 17:00 +0100
    Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Matthias Klose <doko@debian.org> - 2026-01-25 03:30 +0100
      Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Edgar Bonet <linux@edgar-bonet.org> - 2026-01-25 13:20 +0100
        Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Matthias Klose <doko@debian.org> - 2026-01-25 14:50 +0100
          Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Edgar Bonet <linux@edgar-bonet.org> - 2026-01-25 15:00 +0100
            Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Matthias Klose <doko@debian.org> - 2026-01-25 15:10 +0100
              Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack" Edgar Bonet <linux@edgar-bonet.org> - 2026-01-25 17:00 +0100

#1279626 — Bug#1126349: ld segfaults if called with "-r -b binary -z noexecstack"

FromEdgar Bonet <linux@edgar-bonet.org>
Date2026-01-24 17:00 +0100
SubjectBug#1126349: ld segfaults if called with "-r -b binary -z noexecstack"
Message-ID<MgOdj-d0LL-9@gated-at.bofh.it>
Package: binutils
Version: 2.45.50.20260119-1

Dear maintainer,

I am developing a program that needs a text file embedded in its binary
as a "resource" of sorts. I rely on ld for converting the file to an
object file. On Debian sid, however, ld segfaults on me.

How to reproduce:

$ echo foo > foo.txt
$ ld -r -b binary -z noexecstack foo.txt -o foo.o
Segmentation fault         ld -r -b binary -z noexecstack foo.txt -o foo.o

This works fine on Debian testing (with binutils 2.45.50.20251209-1).

Workaround: remove the option "-z noexecstack". This option, however, is
needed on bookworm to prevent a warning on the final link: "missing
.note.GNU-stack section implies executable stack".

Regards,

Edgar Bonet.

[toc] | [next] | [standalone]


#1279678

FromMatthias Klose <doko@debian.org>
Date2026-01-25 03:30 +0100
Message-ID<MgY2Z-d7t9-1@gated-at.bofh.it>
In reply to#1279626
Control: tags -1 + moreinfo

On 1/24/26 16:32, Edgar Bonet wrote:
> Package: binutils
> Version: 2.45.50.20260119-1
> 
> Dear maintainer,
> 
> I am developing a program that needs a text file embedded in its binary
> as a "resource" of sorts. I rely on ld for converting the file to an
> object file. On Debian sid, however, ld segfaults on me.
> 
> How to reproduce:
> 
> $ echo foo > foo.txt
> $ ld -r -b binary -z noexecstack foo.txt -o foo.o
> Segmentation fault         ld -r -b binary -z noexecstack foo.txt -o foo.o
> 
> This works fine on Debian testing (with binutils 2.45.50.20251209-1).
> 
> Workaround: remove the option "-z noexecstack". This option, however, is
> needed on bookworm to prevent a warning on the final link: "missing
> .note.GNU-stack section implies executable stack".

please provide a test case.

[toc] | [prev] | [next] | [standalone]


#1279722

FromEdgar Bonet <linux@edgar-bonet.org>
Date2026-01-25 13:20 +0100
Message-ID<Mh7fX-ddJb-7@gated-at.bofh.it>
In reply to#1279678
Hello!

Matthias Klose wrote:
> please provide a test case.

Here is a test case:

$ echo foo > foo.txt
$ ld -r -b binary -z noexecstack foo.txt -o foo.o
Segmentation fault         ld -r -b binary -z noexecstack foo.txt -o foo.o

Regards,

Edgar.

[toc] | [prev] | [next] | [standalone]


#1279731

FromMatthias Klose <doko@debian.org>
Date2026-01-25 14:50 +0100
Message-ID<Mh8F3-dewa-5@gated-at.bofh.it>
In reply to#1279722
On 1/25/26 13:09, Edgar Bonet wrote:
> ld -r -b binary -z noexecstack foo.txt -o foo.o

thank you, however a test case showing the regression would be more useful.

[toc] | [prev] | [next] | [standalone]


#1279733

FromEdgar Bonet <linux@edgar-bonet.org>
Date2026-01-25 15:00 +0100
Message-ID<Mh8OJ-deAk-7@gated-at.bofh.it>
In reply to#1279731
On 2026-01-25, Matthias Klose wrote:
> a test case showing the regression would be more useful.

I do not quite understand. This test case succeeds on 2.45.50.20251209-1
(as shipped in testing) and fails with a segfault on 2.45.50.20260119-1
(found in sid). Isn't that a test case showing the regression?

[toc] | [prev] | [next] | [standalone]


#1279737

FromMatthias Klose <doko@debian.org>
Date2026-01-25 15:10 +0100
Message-ID<Mh8Yp-deUj-5@gated-at.bofh.it>
In reply to#1279733
On 1/25/26 14:57, Edgar Bonet wrote:
> On 2026-01-25, Matthias Klose wrote:
>> a test case showing the regression would be more useful.
> 
> I do not quite understand. This test case succeeds on 2.45.50.20251209-1
> (as shipped in testing) and fails with a segfault on 2.45.50.20260119-1
> (found in sid). Isn't that a test case showing the regression?

sure, but it's not a senseful test case showing a real issue providing a 
valid binary with 2.45 or 2.45.50.20251209.

[toc] | [prev] | [next] | [standalone]


#1279752

FromEdgar Bonet <linux@edgar-bonet.org>
Date2026-01-25 17:00 +0100
Message-ID<MhaGR-dfOV-1@gated-at.bofh.it>
In reply to#1279737
On 2026-01-25, Matthias Klose wrote:
> it's not a senseful test case showing a real issue providing a valid
> binary with 2.45 or 2.45.50.20251209.

I don't understand what you expect from a “senseful” test case. In my
book, a segfault is always a bug. If you want an example of a real-world
situation where the bug has an impact, try building the feeLLGood
micromagnetic simulator. Here are the build instructions:

    https://feellgood.neel.cnrs.fr/install.html

This build succeeds on forky and fails on sid.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web