# Linux binary on FreeBSD



## dramcio (Dec 29, 2012)

Hello.

I tried to run sv game (normally it*'*s running on linux but *I* try to run it on freebsd FreeBSD).

I got error:


```
109# ./tfs
ELF binary type "3" not known.
./tfs: Exec format error. Binary file not executable.
```


```
pkg_info | grep linux
linux-f10-expat-2.0.1 Linux/i386 binary port of Expat XML-parsing library (Linux
linux-f10-fontconfig-2.6.0 An XML-based font configuration API for X Windows (Linux Fe
linux-f10-xorg-libs-7.4_1 Xorg libraries (Linux Fedora 10)
linux-steam-1.1     Half Life and Source dedicated server using steam
linux_base-f10-10_5 Base set of packages needed in Linux mode for i386/amd64 (L
```


Some advice?

Sorry for my *E*nglish 

Regards

//edit

When *I* try 

```
brandelf -t Linux /home/ots/tfs
```

It does nothing (and returns the same error when *I* want to start "_./tfs_")


```
ELF binary type "3" not known.
```


----------



## Savagedlight (Dec 29, 2012)

According to the handbook, you also need to add 
	
	



```
linux_enable="YES"
```
 to /etc/rc.conf. Then reboot, or execute:
`# kldload linux.ko`


----------



## dramcio (Dec 29, 2012)

I have linux_enable in /etc/rc.conf.


----------



## Terry_Kennedy (Dec 29, 2012)

What is the output from:

```
kldstat
file /home/ots/tfs
readelf -h /home/ots/tfs
```


----------



## dramcio (Dec 29, 2012)

> 109# kldstat
> Id Refs Address            Size     Name
> 1   16 0xffffffff80200000 11cd9b0  kernel
> 2    2 0xffffffff81612000 c16e     ipfw.ko
> ...




```
109# file /home/ots/tfs
/home/ots/tfs: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
```


```
109# readelf -h /home/ots/tfs
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - Linux
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x41ba80
  Start of program headers:          64 (bytes into file)
  Start of section headers:          29648976 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         8
  Size of section headers:           64 (bytes)
  Number of section headers:         40
  Section header string table index: 37
```


----------



## adamk (Dec 29, 2012)

64-bit linux binaries are not supported.

Adam


----------



## dramcio (Dec 29, 2012)

I can't run this file?

I have freebsd FreeBSD 9.0 64 bit :|

There's no idea?


----------



## Terry_Kennedy (Dec 29, 2012)

dramcio said:
			
		

> I can't run this file?


No. You should check to see if it is available for 32-bit Linux systems and use that binary instead.



> I have FreeBSD 9.0 64 bit :|


Yes. But 64-bit FreeBSD doesn't have 64-bit Linux emulation, only 32-bit.


----------



## dramcio (Dec 29, 2012)

But 32-bit supports only 3 GB RAM for this software?


----------



## Terry_Kennedy (Dec 29, 2012)

dramcio said:
			
		

> But 32-bit support only 3 gb ram for this software ?


Yes, somewhere around 3-4GB. I'm not familiar with the program, so I don't know if that's an issue. Presumably if there's a pre-compiled 32-bit binary available, some people must find it useful.


----------



## dramcio (Dec 29, 2012)

I have compile this http://otland.net/f18/8-60-forgotten-server-0-3-6-crying-damson-v7-147913/

On debian 6.0 64 bit, maybe when *I* try to compile on debian 6.0 32 bit, then *I* got 'the forgotten server' in 32 bit?


----------



## Terry_Kennedy (Dec 29, 2012)

dramcio said:
			
		

> I have compile this http://otland.net/f18/8-60-forgotten-server-0-3-6-crying-damson-v7-147913/
> 
> On debian 6.0 64 bit, maybe when i try to compile on debian 6.0 32 bit, then i got 'the forgotten server' in 32 bit?


Probably. You'll need to ask on a Linux or Ubuntu forum, or perhaps on the forum where you downloaded the game. If it was a source that compiles on FreeBSD natively, you can build both 32-bit and 64-bit binaries on a 64-bit system. But I have no idea if Linux can do that (probably) or how.


----------

