This program header in Figure 7.14 indicates that the data segment occupies 0x230 bytes in memory. However only the first 0x228 bytes of these come from the sections of the executable file. What causes this discrepancy?
Figure 7.14 Program header table for the example executable prog. off: offset in Object file; vaddr/paddr: memory address; align: alignment requirement; filesz: segment size in object file; mersz: segment size in memory; flags: run-time permissions.
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Python (4th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Concepts Of Programming Languages
Starting Out with Python (3rd Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
- Question 2 Write a C program which creates two child alternatively and print it on screen. processes. One of the child processes must open data1.txt and fill it with 10 random Sample Run data files and read one data from each file integers (0-9). The other child process must $/question2 open data2.txt and fill it with 10 random PARENT) Child process ID: 5379 letters (a-z). In the meanwhile, parent must CHILD1] wrote: 6 2 8 6 7 3 3 1 8 4 to print both child processes' id's and wait for CHILD2] Wrote: f y nhjw xkpm to them to finish. Then, it must open both file. [PARENT] Child process ID: 5378 file. [PARENT] 6 f 2 y 8 n 6 h 7 j 3 w 3 x 1 k 8 p 4 marrow_forwardInstructions Write a C/C++ program that calculates the least squares line for two sets of values. The program consists of several functions which are described below. int ReadFile (int *, int *); Write a function that reads the contents of a text file (Data1.txt) into two separate integer arrays. The function receives two integer pointers to arrays as parameters. The contents of the text file that is attached is structured as follows: Each line in the file contains two values that are separated by a comma. The values on the left of the comma, are stored in one array and the values on the right side is stored in the other array. The number of lines that are read from the file and stored in the arrays are returned to the calling statement. Tip: a single fscanf can read into multiple variables. Ex. the statement fscanf(fp, "%s %s\n", name,surname) will read the line John Doe and save the name and surname separately. (Note the space between %s and %s indicates that there is a space in the…arrow_forwardWrite a C program that performs the following tasks 1. The program should create three child processes. 2. Each child process should display its PID and the parent PID 3. The first child should display all the numbers from 1 to 100. 4. The second child should display all the content of the source file on the screen. 5. The third child should take two 2x2 arrays as an input and display their sum. 6. The main program should display the message "All child processes have completed" and then exit. 7 Ensure that the all the chiled processes complete their execution before the main program quits.arrow_forward
- C programming language Topic : Input/Output Program : Product list (product.c) Definition : The program reads a series of items form a file and displays the data in columns. The program obtains the file name from the command line. Each line of the file will have the following form: item, mm-dd-yyyy, price For example, suppose that the file contains the following lines: 123, 12.00, 12/25/2006 124, 18.30, 1/10/2020 Expected output: Item Unit Purchase Price Date 123 $ 12.00 12/25/2006 124 $ 18.30 1/10/2020arrow_forwardobject of type streambuf. This object may represent a memory block that acts as an intermediary When we operate with file streams, these are associated to an internal between the stream and the physical file. For example, with an ofstream, each time the member function put (which writes a single character) is called, the character may be inserted in this intermediate buffer instead of being written directly to the physical file with which the stream is associated. O batch O switch binary O bufferarrow_forwardexampleOne This program reads data from a physical file, create a reference to the file, perform a computation, display the result, close the file. package chario; import java.util.Scanner; import java.io.*; //public class Chario { // public static void main(String[] args) throws IOException { File file1 = new File("fileOne.txt"); //Create a reference to the physical file /* Use Notepad to create a text file named fileOne.txt which must be in the same directory that src is in To find src, open your project in NetBeans and hover its name, which is in the top left just below the Projects menu; this will display the path to your project My project path is, yours will be different I:\\Ajava\161\WPPractice\IO\charstream\chario My fileOne.txt is located in chario */ Scanner getit = new Scanner( file1 ); // connect a Scanner to the file int num, square; num = getit.nextInt(); square = num * num ; System.out.println("The square of " + num + " is " + square); getit.close(); //Close the stream…arrow_forward
- 2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 3.8h 6.Oh 1.eh 5. 5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h A report could be produced by a program like this: 0.00h | 5.25h | 1.5en 3.25h 0.5eh 10.00h 0.00h 3.00h 6.00h 1.00h 8.50h 5.50h 2.25h 8.75h 8.25h 8.00h 0.00h | e.00h 2.25h 3.00h 3.00h 5.75h 2.25h Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running total, then writes the report to an output file. Your program should prompt a user to input a…arrow_forwardProgram for simulation of grep unix commands algorithm(C language)STEP1: Start the program STEP2: Declare the variables fline[max], count=0, occurrences=0 and pointers *fp, *newline. STEP 3: Open the file in read mode.STEP4: In while loop check fgets(fline,max,fp)!=NULL STEP 5: Increment count value. STEP 6: Check newline=strchr(fline, „\n‟) STEP 7: print the count,fline value and increment the occurrence value. STEP 8: Stop the programarrow_forwardPYTHON-Assume you have a file that has two columns separated by a comma. The first column contains gene accession numbers, and the second column contain their nucleotide sequence. For example: ABC123, AAGTCTTCCCTAAGCCC... KHJ456, TTCGGTCATACTATTC... NMG789, GCTACTCGATGCTA.... .... The file can contain any number of rows. Write a program that reads in this file (you can create one to test your code with, use TextEdit or Notepad) and creates a dictionary, where the keys are the accession numbers and the values are the sequences. Print out to the screen the dictionary pairs that you created.arrow_forward
- The 2 pictures are the beginning of the lab. The below is for part 2. read_file(0, clear_file); // Read in a file with of unknown length, getting the length from the file read. clear_file is a string containing the path to the clear text file. This function returns a char array created with memory allocation. read_file(len, clear_file); // Where len > zero, reads len chars from a file. clear_file is a string containing the path to the clear text file. This function returns a char array created with memory allocation. write_file(0, key, key_file); // Writes a string to file until the \0 char is reached. key is the string of random chars and key_file is a string containing the path of the text file. write_file(len, cipher, cipher_file); // Where len > zero, writes len chars to a file. cipher is the cipher string of chars and cipher_file is a string containing the path of the text file. The menu in main() should look like: Encrypt a file: 1Decrypt a file: 2Exit:…arrow_forwardComputer Science Write a C/C++ program, call it findExt, to find all files in a directory hierarchy, whose extensions are in the extension list provided as arguments to the program. Your program should print the whole pathnames of the found files. Synopsis: findExt <extension-list> [-t target-directory] When target-directory is missing, the working directory (./) will be the target directory Some sample runs: $ findExt txt pdf That is, find all files whose extensions are either txt or pdf in the directory hierarchy ./ $ findExt jpg -t $HOME //target directory is home directory That is, find all files whose extensions is jpg in the directory hierarchy $HOME Requirement: - You must use the system call nftw() that allows you to walk across a file tree. This system call will do all the recursive walk and each time it visits a file or a directory, it will call your own function (a function that you pass as a parameter).arrow_forwardC++ You must create a header file for each task with implementation as the execute task. Input file A contains numeric values and the Output File A is sorted. Algorithm: a ← read Value from file (A); while not End Of File (A) { b ← read Value from file (A); If a> b { return false; } a ← b; } return true;arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,