elfwrap

Игорь Пашев pashev.igor@gmail.com
Wed Nov 28 20:39:00 GMT 2012


Thanks for suggestions.

So I ended with such code:

.section .passwd, "a", @progbits
.global passwd_start
.global passwd_end
.type passwd_start, @object
.type passwd_end, @object
passwd_start:
.incbin "/etc/passwd"
passwd_end:


End this test:
#include <stdlib.h>
#include <stdio.h>

extern char passwd_start, passwd_end;

int
main ()
{
  char *pstart = &passwd_start, *pend = &passwd_end;

  (void) printf ("%.*s", (pend - pstart), pstart);

  return EXIT_SUCCESS;
}



More information about the Binutils mailing list