int elfu_mCheck(ElfuElf *me);
-ElfuScn* elfu_mCloneScn(ElfuScn *ms);
-
void elfu_mDumpPhdr(ElfuElf *me, ElfuPhdr *mp);
void elfu_mDumpScn(ElfuElf *me, ElfuScn *ms);
+++ /dev/null
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libelfu/libelfu.h>
-
-ElfuScn* elfu_mCloneScn(ElfuScn *ms)
-{
- ElfuScn *newscn;
-
- assert(ms);
-
- newscn = elfu_mScnAlloc();
- if (!newscn) {
- ELFU_WARN("elfu_nCloneScn: Could not allocate memory for new ElfuScn.\n");
- return NULL;
- }
-
- newscn->shdr = ms->shdr;
-
- if (ms->databuf) {
- void *newbuf = malloc(ms->shdr.sh_size);
- if (!newbuf) {
- ELFU_WARN("elfu_nCloneScn: Could not allocate memory for new data buffer.\n");
- free(newscn);
- return NULL;
- }
-
- memcpy(newbuf, ms->databuf, ms->shdr.sh_size);
- newscn->databuf = newbuf;
- }
-
- newscn->oldptr = ms;
-
- return newscn;
-}
#include <libelfu/libelfu.h>
+static ElfuScn* cloneScn(ElfuScn *ms)
+{
+ ElfuScn *newscn;
+
+ assert(ms);
+
+ newscn = elfu_mScnAlloc();
+ if (!newscn) {
+ return NULL;
+ }
+
+ newscn->shdr = ms->shdr;
+
+ if (ms->databuf) {
+ void *newbuf = malloc(ms->shdr.sh_size);
+ if (!newbuf) {
+ ELFU_WARN("cloneScn: Could not allocate memory for new data buffer.\n");
+ free(newscn);
+ return NULL;
+ }
+
+ memcpy(newbuf, ms->databuf, ms->shdr.sh_size);
+ newscn->databuf = newbuf;
+ }
+
+ newscn->oldptr = ms;
+
+ return newscn;
+}
+
+
static int appendData(ElfuScn *ms, void *buf, size_t len)
{
char *newbuf;
ElfuPhdr *injPhdr;
if (oldscn->shdr.sh_flags & SHF_ALLOC) {
- newscn = elfu_mCloneScn(oldscn);
+ newscn = cloneScn(oldscn);
if (!newscn) {
return NULL;
}