394 chapter 8 exceptional control flow an exception

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: is defined in a shared object and called by main2.o gets an entry in the GOT, starting with entry GOT[3]. For the example program, we have shown the GOT entries for printf, which is defined in libc.so and addvec, which is defined in libvector.so. Figure 7.18 shows the PLT for our example program p2. The PLT is an array of 16-byte entries. The first entry, PLT[0], is a special entry that jumps into the dynamic linker. Each called procedure has an entry in the 7.13. TOOLS FOR MANIPULATING OBJECT FILES 381 PLT, starting at PLT[1]. In the figure, PLT[1] corresponds to printf and PLT[2] corresponds to addvec. PLT[0] 08048444: 804844a: 8048450: 8048452: ff ff 00 00 35 78 96 04 08 25 7c 96 04 08 00 00 pushl 0x8049678 jmp *0x804967c # # # # push &GOT[1] jmp to *GOT[2](linker) padding padding PLT[1] <printf> 8048454: ff 25 80 96 04 08 804845a: 68 00 00 00 00 804845f: e9 e0 ff ff ff PLT[2] <addvec> 8048464: ff 25 84 96 04 08 804846a: 68 08 00 00 00 804846f: e9 d0 ff ff ff <other PLT...
View Full Document

Ask a homework question - tutors are online