summaryrefslogtreecommitdiff
path: root/lib/libelf/libelf_extended.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libelf/libelf_extended.c')
-rw-r--r--lib/libelf/libelf_extended.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libelf/libelf_extended.c b/lib/libelf/libelf_extended.c
index 6190ff56d6e..d42bdabd088 100644
--- a/lib/libelf/libelf_extended.c
+++ b/lib/libelf/libelf_extended.c
@@ -29,7 +29,7 @@
#include "_libelf.h"
-ELFTC_VCSID("$Id: libelf_extended.c,v 1.1 2019/02/01 05:27:38 jsg Exp $");
+ELFTC_VCSID("$Id: libelf_extended.c,v 1.2 2019/03/19 02:31:35 jsg Exp $");
/*
* Retrieve section #0, allocating a new section if needed.
@@ -57,7 +57,7 @@ _libelf_setshnum(Elf *e, void *eh, int ec, size_t shnum)
assert(scn->s_ndx == SHN_UNDEF);
if (ec == ELFCLASS32)
- scn->s_shdr.s_shdr32.sh_size = shnum;
+ scn->s_shdr.s_shdr32.sh_size = (Elf32_Word) shnum;
else
scn->s_shdr.s_shdr64.sh_size = shnum;
@@ -87,9 +87,9 @@ _libelf_setshstrndx(Elf *e, void *eh, int ec, size_t shstrndx)
assert(scn->s_ndx == SHN_UNDEF);
if (ec == ELFCLASS32)
- scn->s_shdr.s_shdr32.sh_link = shstrndx;
+ scn->s_shdr.s_shdr32.sh_link = (Elf32_Word) shstrndx;
else
- scn->s_shdr.s_shdr64.sh_link = shstrndx;
+ scn->s_shdr.s_shdr64.sh_link = (Elf64_Word) shstrndx;
(void) elf_flagshdr(scn, ELF_C_SET, ELF_F_DIRTY);
@@ -116,9 +116,9 @@ _libelf_setphnum(Elf *e, void *eh, int ec, size_t phnum)
assert(scn->s_ndx == SHN_UNDEF);
if (ec == ELFCLASS32)
- scn->s_shdr.s_shdr32.sh_info = phnum;
+ scn->s_shdr.s_shdr32.sh_info = (Elf32_Word) phnum;
else
- scn->s_shdr.s_shdr64.sh_info = phnum;
+ scn->s_shdr.s_shdr64.sh_info = (Elf64_Word) phnum;
(void) elf_flagshdr(scn, ELF_C_SET, ELF_F_DIRTY);