On 5/16/24 4:05 PM, Lorenzo Salvadore wrote:
On Thursday, May 16th, 2024 at 20:26, Konstantin Belousov
wrote:
gcc13 from ports
`# gcc ctors.c && ./a.out init 1 init 2 init 5 init 4 init 3 main fini 3 fini 4
fini 5 fini 2 fini 1`
The above order is not expected. I think clang's one is correct
> On May 17, 2024, at 2:26 AM, Konstantin Belousov wrote:
>
> On Thu, May 16, 2024 at 08:06:46PM +0800, Zhenlei Huang wrote:
>> Hi,
>>
>> I'm recently working on https://reviews.freebsd.org/D45194 and got noticed
>> that gcc behaves weirdly.
>>
>> A simple source file to demonstrate that.
>>
On Thu, May 16, 2024 at 08:05:57PM +, Lorenzo Salvadore wrote:
> On Thursday, May 16th, 2024 at 20:26, Konstantin Belousov
> wrote:
> > > gcc13 from ports
> > > `# gcc ctors.c && ./a.out init 1 init 2 init 5 init 4 init 3 main fini 3
> > > fini 4 fini 5 fini 2 fini 1`
> > >
> > > The above
On Thursday, May 16th, 2024 at 20:26, Konstantin Belousov
wrote:
> > gcc13 from ports
> > `# gcc ctors.c && ./a.out init 1 init 2 init 5 init 4 init 3 main fini 3
> > fini 4 fini 5 fini 2 fini 1`
> >
> > The above order is not expected. I think clang's one is correct.
> >
> > Further hacking w
On Thu, May 16, 2024 at 08:06:46PM +0800, Zhenlei Huang wrote:
> Hi,
>
> I'm recently working on https://reviews.freebsd.org/D45194 and got noticed
> that gcc behaves weirdly.
>
> A simple source file to demonstrate that.
>
> ```
> # cat ctors.c
>
> #include
>
> __attribute__((constructor(101
Hi,
I'm recently working on https://reviews.freebsd.org/D45194 and got noticed
that gcc behaves weirdly.
A simple source file to demonstrate that.
```
# cat ctors.c
#include
__attribute__((constructor(101))) void init_101() { puts("init 1"); }
__attribute__((constructor(65535))) void init_655