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] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c


* Andreas Schwab:

> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>
>> Please look at the other patch:
>>
>>   <https://sourceware.org/ml/libc-alpha/2018-06/msg00543.html>
>
> And what do I see there?

The first hunk changes the definition of DEF_STDFILE:

| diff --git a/libio/stdfiles.c b/libio/stdfiles.c
| index 18e1172ad0..2435f412f2 100644
| --- a/libio/stdfiles.c
| +++ b/libio/stdfiles.c
| @@ -33,11 +33,19 @@
|  
|  #include "libioP.h"
|  
| +#ifdef SHARED
| +/* Place the variables defined below in a separate section for the
| +   interposition check in vtables.c.  */
| +# define STDFILE_SECTION __attribute__ ((section ("__libc_IO_stdfiles")))
| +#else
| +# define STDFILE_SECTION
| +#endif
| +
|  #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|    static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|    static struct _IO_wide_data _IO_wide_data_##FD \
|      = { ._wide_vtable = &_IO_wfile_jumps }; \
| -  struct _IO_FILE_plus NAME \
| +  struct _IO_FILE_plus NAME STDFILE_SECTION \
|      = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
|         &_IO_file_jumps};

Without the cleanup, the change would have to happen in two places.


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