Runtime Environment Linking and Loading 1: Slides Credits Prof.Bernhard Egger @SNU CSE
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In the provided code snippet, how many global variables are declared as objects with global binding?

  • 4
  • 3
  • 1
  • 2 (correct)
  • Which function is an example of a weak symbol in the given code?

  • regular_function
  • weak_function (correct)
  • swap
  • extern_function
  • What is the static keyword used for in C programming?

  • To define global variables
  • To control the visibility of functions and variables within the file (correct)
  • To declare immutable constants
  • To enable function overloading
  • Which of the following is NOT a way to declare a weak symbol in C?

    <p>Declaring the variable as static</p> Signup and view all the answers

    What is the significance of 'extern' when used to declare a variable?

    <p>It links the variable declaration to a definition in another file</p> Signup and view all the answers

    Which section does the 'swap' function belong to (based on readelf output)?

    <p>GLOBAL</p> Signup and view all the answers

    What is the size of the 'global_initialized' variable in the readelf output?

    <p>4 bits</p> Signup and view all the answers

    What is the default binding strength for symbols in C?

    <p>Strong</p> Signup and view all the answers

    Which of the following is an example of a not initialized global variable in the readelf output?

    <p>global_static_not_initialized</p> Signup and view all the answers

    What does the command 'gcc -c swap.c' do?

    <p>Creates an object file from the source file swap.c</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser