File: chdr_xlate.h

package info (click to toggle)
elfutils 0.194-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,848 kB
  • sloc: ansic: 115,014; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (33 lines) | stat: -rw-r--r-- 865 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "common.h"

/* These functions convert a while section, one Chdr plus compression data.  */

static void
Elf32_cvt_chdr (void *dest, const void *src, size_t len, int encode)
{
  if (len == 0)
    return;

  /* Move everything over, if necessary, we only need to xlate the
     header, not the compressed data following it.  */
  if (dest != src)
    memmove (dest, src, len);

  if (len >= sizeof (Elf32_Chdr))
    Elf32_cvt_Chdr (dest, src, sizeof (Elf32_Chdr), encode);
}

static void
Elf64_cvt_chdr (void *dest, const void *src, size_t len, int encode)
{
  if (len == 0)
    return;

  /* Move everything over, if necessary, we only need to xlate the
     header, not the compressed data following it.  */
  if (dest != src)
    memmove (dest, src, len);

  if (len >= sizeof (Elf64_Chdr))
    Elf64_cvt_Chdr (dest, src, sizeof (Elf64_Chdr), encode);
}