Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Given that : A relocation entry is {r.offset = 0xf, r.symbol = sum, r.type = R_X86_64_PC32, r.addend = -4} ADDR(s) = ADDR(.text) = 0x4004d0,

1. Given that :

A relocation entry is {r.offset = 0xf, r.symbol = sum, r.type = R_X86_64_PC32, r.addend = -4}

ADDR(s) = ADDR(.text) = 0x4004d0, and

ADDR(r.symbol) = ADDR(sum) = 0x4004e8.

a. What is the address we want to update (refptr)? b.What is the value we want to update (*refptr)?

2. Suppose that a function string_length with the signature int string_length(char *str) is defined in a shared module ./libstr.so. Write a program that can dynamically load the library during the run-time and call the function string_length with the string hello world and unload the module. Implement the program using the functions below:

void *dlopen(const char *filename, int flag /*RTLD_GLOBAL, RTLD_NOW, RTLD_LAZY*/);

void *dlsym(void *handle, char *symbol);

int dlclose(void *handle); ? const char *dlerror(void);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Question May a taxpayer roll over money from an IRA to an HSA?

Answered: 1 week ago

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago