[PATCH v2 2/2] rtld: Add tests for new --no-default-paths option

Joseph Myers joseph@codesourcery.com
Thu May 27 16:36:06 GMT 2021


On Thu, 27 May 2021, Fergus Dall via Libc-alpha wrote:

> +const char libc[] = "/libc.so.6";
> +const char libdl[] = "/libdl.so.2";

If these are meant to be the SONAMEs of libc and libdl (with "/" 
prepended), you should use LIBC_SO and LIBDL_SO from <gnu/lib-names.h>.  
Some configurations have different SONAMEs (look for libc= and libdl= in 
shlib-versions files).  Also watch out for any interaction with Florian's 
patches to move libdl into libc.

> +  strcpy(lib_src, support_slibdir_prefix);

Throughout this patch, there should be a space before '(' in function 
calls; tests should follow GNU style, like other glibc code.  (In the GCC 
and GDB testsuites, it's useful to have code with a range of different 
styles, to make sure those tools work well with such code, but that 
doesn't apply to the glibc testsuite.)

> +const char libc[] = "/libc.so.6";
> +const char libdl[] = "/libdl.so.2";

Same comment about using <gnu/lib-names.h> applies here.

> +int main(int argc, char *argv[]) {
> +  if (argc < 2) {
> +    FAIL_EXIT1(usage);
> +  }

Again, GNU style fixes.  Return type on its own line, space before '(', 
open braces on their own lines (and indented from the "if").

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list