Collin Funk wrote: > > max_align_t evp_ctx_buffer[256 / sizeof (max_align_t)]; > > I had assumed that 256 bytes would be aligned everywhere, but > max_align_t seams more robust, thanks.
The alignment of an array of N elements with base type T is the same as the alignment of T. A compiler is free to allocate it with a higher alignment if it's a variable (but not if it's a struct member). > > (with dlsym RTLD_NEXT), in such a way that these overrides abort if the > > size argument is > 256. This test should only be activated on __ELF__ > > systems, because on the other ones (macOS, Windows, etc.) you probably > > can't rely on dlsym RTLD_NEXT. > > Good idea. But wouldn't it be easier to steal coreutils gcc_shared_() > function from init.cfg and use LD_PRELOAD? Here is an example [1]. I would expect dlsym RTLD_NEXT to be more portable than LD_PRELOAD. But since it's just a gut feeling of mine and it's an interesting question, I will create an example of both approaches and show the results. Bruno
