Compiling bind9 may throw this error
/bin/sh [...]/bind-9.8.4/libtool --mode=link --tag=CC gcc -shared -o driver.so
driver.lo
libtool: link: gcc -o driver.so .libs/driver.o
/usr/lib/gcc/i486-suse-linux/3.4.6/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
during compilation in folder dlzexternal.
Most probably reason for this is bug in bin/tests/system/dlzexternal/Makefile.in. Replace this line
${LIBTOOL_MODE_LINK} @SO_LD@ -o $@ driver.@O@
by
${LIBTOOL_MODE_LINK} @SO_LD@ -o $@ driver.@O@ dlopen.@O@
Dienstag, 16. Oktober 2012
Montag, 9. April 2012
Linux kernel 2.4.x: modutils and SIGSEGV
Kernel modules compiled using "modern" compilers like GCC 3.4.x create modules that may raise SIGSEGV errors if accessed by modutil tools. Reason is "richer" ELF tables that may contain entries of type ABS lacking a name entry. Example (using readelf with argument -s):
ELF tables use some signal values for struct property st_shndx. Vanilla code of modutils (up 2.4.27) does not respect those special values and use them as array index. SHN_ABS is defined as 0xFFF1 (see elf.h) which is decimal 65521. Using that as index into array pointed to by f->sections creates fairly sure SIGSEGV as mentioned earlier.
Following patch applied on file obj_load.c
Symbol table '.symtab' contains 473 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND [...] 16: 00000000 0 FILE LOCAL DEFAULT ABS [...]
ELF tables use some signal values for struct property st_shndx. Vanilla code of modutils (up 2.4.27) does not respect those special values and use them as array index. SHN_ABS is defined as 0xFFF1 (see elf.h) which is decimal 65521. Using that as index into array pointed to by f->sections creates fairly sure SIGSEGV as mentioned earlier.
Following patch applied on file obj_load.c
--- modutils-2.4.27-orig/obj/obj_load.c 2003-10-27 03:59:12.000000000 +0100
+++ modutils-2.4.27/obj/obj_load.c 2012-04-07 17:52:05.000000000 +0200
@@ -232,10 +232,10 @@
/* Insert all symbols into the hash table. */
for (j = 1, ++sym; j < nsym; ++j, ++sym)
{
- const char *name;
+ const char *name = "";
if (sym->st_name)
name = strtab+sym->st_name;
- else
+ else if (sym->st_shndx < SHN_LORESERVE)
name = f->sections[sym->st_shndx]->name;
{
fixes that issue.
Abonnieren
Posts (Atom)