Discussion:
how to compile this file
Add Reply
Ho Yeung Lee
2017-05-17 17:40:28 UTC
Reply
Permalink
Raw Message
wget http://ukai.jp/Software/livepatch/livepatch.c


***@ubuntu:~/Downloads$ make
cc -Wall -O2 -g -c -o livepatch.o livepatch.c
livepatch.c:22:24: fatal error: linux/user.h: No such file or directory
#include <linux/user.h>
^
compilation terminated.
make: *** [livepatch.o] Error 1

compile error

then change

#include <linux/user.h>

to

#include <sys/user.h>

***@ubuntu:~/Downloads$ make
cc -o livepatch livepatch.o -lbfd
livepatch.o: In function `bfd_map_section_alloc_size':
/home/martin/Downloads/livepatch.c:271: undefined reference to `bfd_get_section_size_before_reloc'
livepatch.o: In function `bfd_map_section_buf':
/home/martin/Downloads/livepatch.c:285: undefined reference to `bfd_get_section_size_before_reloc'
livepatch.o: In function `bfd_load_section':
/home/martin/Downloads/livepatch.c:190: undefined reference to `bfd_get_section_size_before_reloc'
collect2: error: ld returned 1 exit status
make: *** [livepatch] Error 1
James R. Kuyper
2017-05-17 18:06:42 UTC
Reply
Permalink
Raw Message
Post by Ho Yeung Lee
wget http://ukai.jp/Software/livepatch/livepatch.c
cc -Wall -O2 -g -c -o livepatch.o livepatch.c
livepatch.c:22:24: fatal error: linux/user.h: No such file or directory
#include <linux/user.h>
^
<http://ukai.jp/Software/livepatch> says
AUTHOR
Fumitoshi UKAI <***@debian.or.jp>

I recommend sending such questions to him.
Noob
2017-05-17 22:17:38 UTC
Reply
Permalink
Raw Message
Post by Ho Yeung Lee
cc -o livepatch livepatch.o -lbfd
/home/martin/Downloads/livepatch.c:271: undefined reference to `bfd_get_section_size_before_reloc'
/home/martin/Downloads/livepatch.c:285: undefined reference to `bfd_get_section_size_before_reloc'
/home/martin/Downloads/livepatch.c:190: undefined reference to `bfd_get_section_size_before_reloc'
collect2: error: ld returned 1 exit status
make: *** [livepatch] Error 1
http://ukai.jp/Software/livepatch/
"I used binutils-dev 2.15-4"
binutils 2.15 was released 13 years ago.

https://lists.freebsd.org/pipermail/svn-src-projects/2010-October/003141.html
http://binutils.sourceware.narkive.com/CDGlLhYL/section-raw-size-and-cooked-size

If you need help, there's a binutils ML:
https://sourceware.org/ml/binutils/

Regards.

Loading...