Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 19 Jan 2020 20:32:57 +0300 (MSK)
From: Alexander Monakov <>
Subject: Re: Minor style patch to exit.c

On Sun, 19 Jan 2020, Rich Felker wrote:

> > I would suggest
> > 
> >   void (**ptr)(void);
> > 
> >   __asm__ ("" : "=g"(ptr) : "0"(..._end), "X"(..._start));
> > 
> >   while (ptr != _start) (*--ptr)();
> I think we could just put the assignment outside the asm and use "+g".
> Not clear why _start is needed as an input operand. It's external so
> asm must be assumed to be able to see it.

In the context of LTO asms really need to mention referenced symbols in
constraints. Plus, it's good to have "the pointer is related to _start"
spelled out in the code.

> BTW does the "X" constraint work all the way back to ancient gcc (and
> then presumably with pcc, clang)? The first time I ever saw it was in
> one of your other patches.

gcc documentation says 2.95 already had it.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.