Re: [PATCH] Fix gdb.dwarf2/clztest.exp with Clang

Rainer Orth
2020-11-02T19:30:05Z

Hi Gary,

> Andreas Schwab wrote:
>> On Nov 02 2020, Gary Benson via Gdb-patches wrote:
>> > diff --git a/gdb/testsuite/gdb.dwarf2/clztest.S b/gdb/testsuite/gdb.dwarf2/clztest.S
>> > index a904fee..08a8bac 100644
>> > --- a/gdb/testsuite/gdb.dwarf2/clztest.S
>> > +++ b/gdb/testsuite/gdb.dwarf2/clztest.S
>> > @@ -22,6 +22,12 @@
>> >
>> > */
>> >
>> > +#if defined(__clang__)
>> > +# define EH_FRAME_SH_FLAGS "a"
>> > +#else
>> > +# define EH_FRAME_SH_FLAGS "aw"
>> > +#endif
>> > +
>> > .file "clztest.c"
>> > .text
>> > .Ltext0:
>> > @@ -178,7 +184,7 @@ _start:
>> > .LEFDE4:
>> > #NO_APP
>> > #APP
>> > - .section .eh_frame,"aw",@progbits
>> > + .section .eh_frame,EH_FRAME_SH_FLAGS,@progbits
>>
>> Shouldn't .eh_frame always be read-only?
>
> I don't know.
>
>> It certainly is when compiled with gcc.
>
> A comment in that .S file indicated it was originally generated
> using GCC (via gcc -dA -S -g -O2 clztest.c -o clztest.S) but that
> was 2011, so maybe things changed.
>
> I'm happy to change the test to have .eh_frame read-only for all
> compilers, if that seems more correct.

it's not: cf. EH_TABLES_CAN_BE_READ_ONLY in gcc/config/i386/sol2.h and
DWARF2_EH_FRAME_READ_ONLY in gas/config/te-solaris.h and
gas/config/tc-hppa.h.

Rainer

--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University