bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/28262] Add warning when generating code in data section


From: dcmay at copper dot net
Subject: [Bug gas/28262] Add warning when generating code in data section
Date: Mon, 06 Sep 2021 03:10:42 +0000

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

--- Comment #2 from Dietmar May <dcmay at copper dot net> ---
> Are you sure about this ?  If the code is in a non-executable section then it 
> should be linked into a non-executable segment, and so it should never be run.

Please see the attachment for 28254:
https://sourceware.org/bugzilla/show_bug.cgi?id=28254

This assembled, linked, ran and debugged just fine under binutils 2.35.1
(linaro 10.2.1 aarch64 toolchain).

When running under binutils 2.36.1 (linaro 10.3.1 aarch64 toolchain), suddenly
gdb stopped stepping and handling breakpoints in the code.

Turns out, the assembler code is being considered data, due to a missing "x"
flag on the section.

However, perhaps because of the layout in the ld file, it will happily get
placed at the correct location; and the processor will happily execute it.

In 2.35.1, gdb had debugging info, so it happily stepped and honored
breakpoints. In 2.36.1, due to a PR, no debug info is emitted for any data
section. Hence, GDB becomes confused and won't debug the code, even though it
still runs fine.

Me, I'm still confused as to why any section that contains only assembler code
would default to be data. Seems like the default for a section should depend on
what that section contains ...

But since that's not likely to change, a simple warning could have saved a
whole lot of trouble, for more than one person.

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