Perpetual Weekend

2 June 2008

Finding linux-gate.so.1 in Assembly

Filed under: Uncategorized — Tags: , , , , , , , — shaurz @ 11:03

A question was posted to reddit and I couldn’t help but indulge my curiosity. System calls on Linux x86 traditionally use the interrupt vector 0×80. Modern processors have special system call instructions which are much faster, so Linux has an entry point called “linux-gate.so.1″ (a virtual DSO) which will choose the best system call method for your machine. I found a webpage which explains about linux-gate and another which explains how to find the ELF auxv (auxiliary vector) which contains the address of the entry point. So I put together a small assembly program which finds the linux-gate syscall entry point and uses it to print a message to stdout. I haven’t written any assembly for quite a while :-) Use FASM to assemble the code.

Download: linuxgate.asm

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.