This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove nested function in elf/dl-lookup.c.


On 02/13/2014 03:26 AM, Rich Felker wrote:

I completely agree that removing nested functions improves
readability. The first time I saw this code it was a pain to make
sense of it. I do not think most people are familiar with GCC nested
functions, and they are unsafe to use unless you can be sure that they
will be inlined (if not, they require executable stack)

The situation is not as dire as you paint it. A trampoline is only needed if the address of the function is taken. Non-inlined direct calls are fine and handled with an implicit frame argument, something that is not possible with indirect calls (except on architectures with function descriptors).

That doesn't mean I'm in favor of keeping inline functions. They are one of the more obscure GCC extensions. They increase readability if they are used consistently and regularly, but a few isolated cases seem to have the opposite effect.

--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]