System calls are provided on ia32 systems via a

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: 5 6 7 8 /* foo6.c */ void p2(void); int main() { p2(); return 0; } 1 2 3 4 5 6 7 8 9 /* bar6.c */ #include <stdio.h> char main; void p2() { printf("0x%x\n", main); } When this program is compiled and executed on a Linux system, it prints the string “0x55\n” and terminates normally, even though p2 never initializes variable main. Can you explain this? Homework Problem 7.10 [Category 1]: Let a and b denote object modules or static libraries in the current directory, and let a b denote that a depends on b, in the sense that b defines a symbol that is referenced by a. For each of the following scenarios, show the minimal command line (i.e., one with the least number of file object file and library arguments) that will allow the static linker to resolve all symbol references. A. p.o B. p.o C. p.o libx.a libx.a libx.a p.o. liby.a and liby.a liby.a libx.a. libx.a libz.a. libz.a and liby.a Homework Problem 7.11 [Category 1]: 386 CHAPTER 7. LINKING The segment header in Figure 7.12 indicates that the data...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online