Ld-linux - specify exit codes

Checking the source from / usr / bin / ldd, I see that it uses ld-linux to find the dependencies of the executable, although it first calls ld-linux with the -verify argument. The script then acts differently according to the exit code of the ld-linux -verify call.

The man page for ld-linux does not provide any information on exit codes, and a Google search has nothing useful. Is there any documentation anywhere (except when searching for ld-linux source code) that provides a list of exit codes for ld-linux -verfify and their corresponding values?

+3
source share
2 answers

, , 1 - . , , script.

, , , .

+1

, ...

  if (__builtin_expect (mode, normal) == verify)
    {
      /* We were called just to verify that this is a dynamic
         executable using us as the program interpreter.  Exit with an
         error if we were not able to load the binary or no interpreter
         is specified (i.e., this is no dynamically linked binary.  */
      if (main_map->l_ld == NULL)
        _exit (1);

      /* We allow here some platform specific code.  */
#ifdef DISTINGUISH_LIB_VERSIONS
      DISTINGUISH_LIB_VERSIONS;
#endif
      _exit (has_interp ? 0 : 2);
    }

...

  • 0 , " , "
  • 1 , ld-linux " " ( , ld-linux , )
  • 2 , . , p_type PT_INTERP ( ld-linux )

.

+1

Source: https://habr.com/ru/post/1714798/


All Articles