LCOV - code coverage report
Current view: top level - libelf - chdr_xlate.h (source / functions) Coverage Total Hit
Test: elfutils-0.193 Lines: 100.0 % 12 12
Test Date: 2025-08-30 14:31:09 Functions: 100.0 % 2 2
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 50.0 % 12 6

             Branch data     Line data    Source code
       1                 :             : #include "common.h"
       2                 :             : 
       3                 :             : /* These functions convert a while section, one Chdr plus compression data.  */
       4                 :             : 
       5                 :             : static void
       6                 :         730 : Elf32_cvt_chdr (void *dest, const void *src, size_t len, int encode)
       7                 :             : {
       8         [ +  - ]:         730 :   if (len == 0)
       9                 :             :     return;
      10                 :             : 
      11                 :             :   /* Move everything over, if necessary, we only need to xlate the
      12                 :             :      header, not the compressed data following it.  */
      13         [ +  - ]:         730 :   if (dest != src)
      14                 :         730 :     memmove (dest, src, len);
      15                 :             : 
      16         [ +  - ]:         730 :   if (len >= sizeof (Elf32_Chdr))
      17                 :         730 :     Elf32_cvt_Chdr (dest, src, sizeof (Elf32_Chdr), encode);
      18                 :             : }
      19                 :             : 
      20                 :             : static void
      21                 :         816 : Elf64_cvt_chdr (void *dest, const void *src, size_t len, int encode)
      22                 :             : {
      23         [ +  - ]:         816 :   if (len == 0)
      24                 :             :     return;
      25                 :             : 
      26                 :             :   /* Move everything over, if necessary, we only need to xlate the
      27                 :             :      header, not the compressed data following it.  */
      28         [ +  - ]:         816 :   if (dest != src)
      29                 :         816 :     memmove (dest, src, len);
      30                 :             : 
      31         [ +  - ]:         816 :   if (len >= sizeof (Elf64_Chdr))
      32                 :         816 :     Elf64_cvt_Chdr (dest, src, sizeof (Elf64_Chdr), encode);
      33                 :             : }
        

Generated by: LCOV version 2.0-1