This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: elfwrap
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;
}