Link 2. Object Files

Similar documents
Link 2. Object Files

Link 4. Relocation. Young W. Lim Wed. Young W. Lim Link 4. Relocation Wed 1 / 22

Link 4. Relocation. Young W. Lim Thr. Young W. Lim Link 4. Relocation Thr 1 / 26

Link 4. Relocation. Young W. Lim Sat. Young W. Lim Link 4. Relocation Sat 1 / 33

Link 4. Relocation. Young W. Lim Mon. Young W. Lim Link 4. Relocation Mon 1 / 35

Link 4. Relocation. Young W. Lim Tue. Young W. Lim Link 4. Relocation Tue 1 / 38

Link 4. Relocation. Young W. Lim Thr. Young W. Lim Link 4. Relocation Thr 1 / 48

Procedure Calls. Young W. Lim Sat. Young W. Lim Procedure Calls Sat 1 / 27

Link 3. Symbols. Young W. Lim Mon. Young W. Lim Link 3. Symbols Mon 1 / 42

Procedure Calls. Young W. Lim Mon. Young W. Lim Procedure Calls Mon 1 / 29

Stack Tutorial. Young W. Lim Sat. Young W. Lim Stack Tutorial Sat 1 / 15

Access. Young W. Lim Sat. Young W. Lim Access Sat 1 / 19

CSE2421 Systems1 Introduction to Low-Level Programming and Computer Organization

Access. Young W. Lim Fri. Young W. Lim Access Fri 1 / 18

Link 7. Static Linking

Arrays. Young W. Lim Mon. Young W. Lim Arrays Mon 1 / 17

238P: Operating Systems. Lecture 7: Basic Architecture of a Program. Anton Burtsev January, 2018

Stack Debugging. Young W. Lim Sat. Young W. Lim Stack Debugging Sat 1 / 40

Arrays. Young W. Lim Wed. Young W. Lim Arrays Wed 1 / 19

Binghamton University. CS-220 Spring Loading Code. Computer Systems Chapter 7.5, 7.8, 7.9

CMSC 313 Lecture 12. Project 3 Questions. How C functions pass parameters. UMBC, CMSC313, Richard Chang

Intro x86 Part 3: Linux Tools & Analysis

CMSC 313 Lecture 12 [draft] How C functions pass parameters

CS , Fall 2001 Exam 1

ELF (1A) Young Won Lim 10/22/14

CSC 2400: Computing Systems. X86 Assembly: Function Calls

Example C program. 11: Linking. Why linkers? Modularity! Static linking. Why linkers? Efficiency! What do linkers do? 10/28/2013

Turning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p

Homework. In-line Assembly Code Machine Language Program Efficiency Tricks Reading PAL, pp 3-6, Practice Exam 1

CSC 405 Computer Security Stack Canaries & ASLR

CS , Spring 2004 Exam 1

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING PREVIEW SLIDES 16, SPRING 2013

Lecture 16: Linking Computer Architecture and Systems Programming ( )

238P: Operating Systems. Lecture 4: Linking and Loading (Basic architecture of a program) Anton Burtsev October, 2018

CS 550 Operating Systems Spring Process I

Link 7. Dynamic Linking

Example C Program The course that gives CMU its Zip! Linking March 2, Static Linking. Why Linkers? Page # Topics

Link Edits and Relocatable Code

Introduction to Computer Systems , fall th Lecture, Sep. 28 th

Link 8.A Dynamic Linking

Machine Programming 1: Introduction

AS08-C++ and Assembly Calling and Returning. CS220 Logic Design AS08-C++ and Assembly. AS08-C++ and Assembly Calling Conventions

Link 7.A Static Linking

CS , Fall 2004 Exam 1

Buffer Overflow Attack

Linking February 24, 2005

143A: Principles of Operating Systems. Lecture 4: Linking and Loading (Basic architecture of a program) Anton Burtsev October, 2018

CS , Fall 2002 Exam 1

UW CSE 351, Winter 2013 Midterm Exam

COMPILING OBJECTS AND OTHER LANGUAGE IMPLEMENTATION ISSUES. Credit: Mostly Bryant & O Hallaron

CS 2505 Computer Organization I Test 2. Do not start the test until instructed to do so! printed

Labeling Library Functions in Stripped Binaries

Linking Oct. 26, 2009"

Assembly Programmer s View Lecture 4A Machine-Level Programming I: Introduction

CSC 2400: Computing Systems. X86 Assembly: Function Calls"

CSC 405 Computer Security Reverse Engineering Part 1

A SimplisHc Program TranslaHon Scheme. TranslaHng the Example Program. Example C Program. Why Linkers? - Modularity. Linking

Stack Debugging. Young W. Lim Thr. Young W. Lim Stack Debugging Thr 1 / 12

LINKING. Jo, Heeseung

1 /* file cpuid2.s */ 4.asciz "The processor Vendor ID is %s \n" 5.section.bss. 6.lcomm buffer, section.text. 8.globl _start.

Overview REWARDS TIE HOWARD Summary CS 6V Data Structure Reverse Engineering. Zhiqiang Lin

Assembly I: Basic Operations. Jo, Heeseung

Machine-level Programming (3)

GDB Tutorial. Young W. Lim Thr. Young W. Lim GDB Tutorial Thr 1 / 24

CMSC 313 Fall2009 Midterm Exam 2 Section 01 Nov 11, 2009

CS241 Computer Organization Spring 2015 IA

administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions?

ASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung

CS429: Computer Organization and Architecture

GDB Tutorial. Young W. Lim Tue. Young W. Lim GDB Tutorial Tue 1 / 32

CPEG421/621 Tutorial

GDB Tutorial. Young W. Lim Fri. Young W. Lim GDB Tutorial Fri 1 / 24

Full Name: CISC 360, Fall 2008 Example of Exam

ELF (1A) Young Won Lim 3/24/16

Linking and Loading. CS61, Lecture 16. Prof. Stephen Chong October 25, 2011

CSE351 Autumn 2012 Midterm Exam (5 Nov 2012)

Relocating Symbols and Resolving External References. CS429: Computer Organization and Architecture. m.o Relocation Info

CISC 360. Machine-Level Programming I: Introduction Sept. 18, 2008

15-213/18-243, Spring 2011 Exam 1

Practical Malware Analysis

Systems I. Linking II

Machine-Level Programming I: Introduction Jan. 30, 2001

Y86 Processor State. Instruction Example. Encoding Registers. Lecture 7A. Computer Architecture I Instruction Set Architecture Assembly Language View

Linking. Today. Next time. Static linking Object files Static & dynamically linked libraries. Exceptional control flows

Instruction Set Architecture

Instruction Set Architecture

Lecture 2 Assembly Language

Overview of Compiler. A. Introduction

CPS104 Recitation: Assembly Programming

Assembly Language: Function Calls

Assembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University

Computer Systems Organization V Fall 2009

Linking. Explain what ELF format is. Explain what an executable is and how it got that way. With huge thanks to Steve Chong for his notes from CS61.

Control flow. Condition codes Conditional and unconditional jumps Loops Switch statements

Example C Program. Linking CS Instructor: Sanjeev Se(a. int buf[2] = {1, 2}; extern int buf[]; int main() { swap(); return 0; }

CF Carry Flag SF Sign Flag ZF Zero Flag OF Overflow Flag. ! CF set if carry out from most significant bit. "Used to detect unsigned overflow

Machine-Level Programming Introduction

Assembly Language: Function Calls" Goals of this Lecture"

Condition Codes. Lecture 4B Machine-Level Programming II: Control Flow. Setting Condition Codes (cont.) Setting Condition Codes (cont.

CSC 591 Systems Attacks and Defenses Reverse Engineering Part 1

Transcription:

Link 2. Object Files Young W. Lim 2017-09-23 Sat Young W. Lim Link 2. Object Files 2017-09-23 Sat 1 / 40

Outline 1 Linking - 2. Object Files Based on Oject Files ELF Sections Example Program Source Codes Object File Comparsion Assembly code analysis 1. main Assembly code analysis 2. swap Relocatable Object Files Executable Object Files Young W. Lim Link 2. Object Files 2017-09-23 Sat 2 / 40

Based on "Self-service Linux: Mastering the Art of Problem Determination", Mark Wilding "Computer Architecture: A Programmer s Perspective", Bryant & O Hallaron I, the copyright holder of this work, hereby publish it under the following licenses: GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. CC BY SA This file is licensed under the Creative Commons Attribution ShareAlike 3.0 Unported License. In short: you are free to share and make derivative works of the file under the conditions that you appropriately attribute it, and that you distribute it only under a license compatible with this one. Young W. Lim Link 2. Object Files 2017-09-23 Sat 3 / 40

Object Files Relocatable object file Executable object file Shared object file Young W. Lim Link 2. Object Files 2017-09-23 Sat 4 / 40

Relocatable Object Files Relocatable object file contains binary code and data in a form that can be combined with other relocatable object files at compile time to create an executable object file Young W. Lim Link 2. Object Files 2017-09-23 Sat 5 / 40

Executable Object Files Shared object file a special relocatable object file that can be loaded into memory and linke dynamically at either load time or run time Young W. Lim Link 2. Object Files 2017-09-23 Sat 6 / 40

Types of Excutable Object Files a.out COFF (Common Object File format) PE (Portable Executable format) ELF (Executable and Linkable Format) Young W. Lim Link 2. Object Files 2017-09-23 Sat 7 / 40

ELF Relocatable Object Files Linking View ELF Header Program Header Table Section 1 Section 2 Section 3............... Section n Section Header Table Possible Section Types.text.rodata.data.bss.symtab.rel.text.rel.data.debug.line.strtab Program Header Table is optional Young W. Lim Link 2. Object Files 2017-09-23 Sat 8 / 40

ELF Header 16-byte sequence : the word size and byte ordering information that allows a linker to parse and interpret the object file the size of ELF header the object file type (relocatble, executable, shared) the machine type Young W. Lim Link 2. Object Files 2017-09-23 Sat 9 / 40

Program Header Table 1 tells the system how to create a process image executable files must have program header table relocatable files do not need (optional) need for execution 1 http://www.skyfree.org/linux/references/elf_format.pdf Young W. Lim Link 2. Object Files 2017-09-23 Sat 10 / 40

Section Header Table 1 identifies all the sections in the file every section in the file has an entry in the section header table an array of structures with an index the file offset of the section header table the size and number of entries in the section header table contains a fixed sized entry for each section in the object file relocatable files must have program header table executable files do not need (optional) need for linking Young W. Lim Link 2. Object Files 2017-09-23 Sat 11 / 40

Memory Map environment vars commandline args stack......... heap uninit.bss init.data text Young W. Lim Link 2. Object Files 2017-09-23 Sat 12 / 40

.text,.rodata.text the machine code.rodata read only data string constants jump tables for swtich statements Young W. Lim Link 2. Object Files 2017-09-23 Sat 13 / 40

.data,.bss.data initialized global variables initialized static variables no local variables (on the stack, at the run time) occupy actual space in the object file.bss uninitialized global variables uninitialized static variables no local variables (on the stack, at the run time) no actual space in the object file just a place holder for space efficiency Young W. Lim Link 2. Object Files 2017-09-23 Sat 14 / 40

.symtab.symtab symbol table information about functions and global variables regardless of -g compile switch every relocatable object file has a symbol table in.symtab the symbol table in.symtab no entries for local variables the symbol table inside a compiler does have entries for local variables Young W. Lim Link 2. Object Files 2017-09-23 Sat 15 / 40

.rel.text.rel.text locations in the text section will be changed when linker combines object files instructions that need to be changed: calls an external function references a global variable instructions that calls local functions : no need to be changed executable object files do not need relocation information is usually omitted without an explicit instruction to include it Young W. Lim Link 2. Object Files 2017-09-23 Sat 16 / 40

.rel.data.rel.data relocation information for any global variables that are referenced or defined by the module any initialized global variable will need to be modified whose initial value is the address of a global variable externally defined function Young W. Lim Link 2. Object Files 2017-09-23 Sat 17 / 40

.debug.debug a debugging symbole table entries local variables typedefs global variables only present when compiled with the -g option Young W. Lim Link 2. Object Files 2017-09-23 Sat 18 / 40

.line.line a mapping between line numbers and machine code instructions in the.text only present when compiled with the -g option Young W. Lim Link 2. Object Files 2017-09-23 Sat 19 / 40

.strtab.strtab a string table for the symbol tables in the.symtab and.debug sections and for the section names in the section headers a string table is a sequence of null-terminated character string Young W. Lim Link 2. Object Files 2017-09-23 Sat 20 / 40

c source code // swap.c --------------------- // main.c --------------------- void swap(); int buf[2] = {1, 2}; int main() { swap(); extern int buf[]; int *p0 = &buf[0]; int *p1; void swap() { int tmp; p1 = &buf[1]; } return 0; tmp = *p0; *p0 = *p1; *p1 = tmp; } Young W. Lim Link 2. Object Files 2017-09-23 Sat 21 / 40

main source and assembly codes // main.c --------------------- void swap(); int buf[2] = {1, 2}; int main() { swap(); return 0; } 00000000 <main>: 0: lea 0x4(%esp),%ecx 4: and $0xfffffff0,%esp 7: pushl -0x4(%ecx) a: push %ebp b: mov %esp,%ebp d: push %ecx e: sub $0x4,%esp 11: call 12 <main+0x12> 16: add $0x4,%esp 19: xor %eax,%eax 1b: pop %ecx 1c: pop %ebp 1d: lea -0x4(%ecx),%esp 20: ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 22 / 40

swap source and assembly codes // swap.c --------------------- extern int buf[]; int *p0 = &buf[0]; int *p1; void swap() { int tmp; } p1 = &buf[1]; tmp = *p0; *p0 = *p1; *p1 = tmp; 00000000 <swap>: 0: mov 0x0,%eax 5: mov 0x4,%ecx b: movl $0x4,0x0 12: 15: mov (%eax),%edx 17: mov %ecx,(%eax) 19: mov %edx,0x4 1f: ret +----------+ p0 buf[0] +----------+ p1 buf[1] +----------+ Young W. Lim Link 2. Object Files 2017-09-23 Sat 23 / 40

swap assembly codes witout optimization -O2 00000000 <swap>: 0: push %ebp 1: mov %esp,%ebp 3: sub $0x10,%esp 6: movl $0x4,0x0 d: 10: mov 0x0,%eax 15: mov (%eax),%eax 17: mov %eax,-0x4(%ebp) 1a: mov 0x0,%eax 1f: mov 0x0,%edx 25: mov (%edx),%edx 27: mov %edx,(%eax) 29: mov 0x0,%eax 2e: mov -0x4(%ebp),%edx 31: mov %edx,(%eax) 33: nop 34: leave 35: ret -O3 00000000 <swap>: 0: mov 0x0,%eax 5: mov 0x4,%ecx b: movl $0x4,0x0 12: 15: mov (%eax),%edx 17: mov %ecx,(%eax) 19: mov %edx,0x4 1f: ret +----------+ p0 buf[0] +----------+ p1 buf[1] +----------+ Young W. Lim Link 2. Object Files 2017-09-23 Sat 24 / 40

relocatable and executable main s relocatable main 00000000 <main>: 0: lea 0x4(%esp),%ecx 4: and $0xfffffff0,%esp 7: pushl -0x4(%ecx) a: push %ebp b: mov %esp,%ebp d: push %ecx e: sub $0x4,%esp 11: call 12 <main+0x12> 16: add $0x4,%esp 19: xor %eax,%eax 1b: pop %ecx 1c: pop %ebp 1d: lea -0x4(%ecx),%esp 20: ret executable main 080482e0 <main>: 80482e0: lea 0x4(%esp),%ecx 80482e4: and $0xfffffff0,%esp 80482e7: pushl -0x4(%ecx) 80482ea: push %ebp 80482eb: mov %esp,%ebp 80482ed: push %ecx 80482ee: sub $0x4,%esp 80482f1: call 8048400 <swap> 80482f6: add $0x4,%esp 80482f9: xor %eax,%eax 80482fb: pop %ecx 80482fc: pop %ebp 80482fd: lea -0x4(%ecx),%esp 8048300: ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 25 / 40

relocatable and executable swap s relocatable swap 00000000 <swap>: 0: mov 0x0,%eax 5: mov 0x4,%ecx b: movl $0x4,0x0 12: 15: mov (%eax),%edx 17: mov %ecx,(%eax) 19: mov %edx,0x4 1f: ret executable swap 08048400 <swap>: 8048400: mov 0x804a020,%eax 8048405: mov 0x804a01c,%ecx 804840b: movl $0x804a01c,0x804a028 8048412: 8048415: mov (%eax),%edx 8048417: mov %ecx,(%eax) 8048419: mov %edx,0x804a01c 804841f: ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 26 / 40

(1) 16-byte alignment 0: lea 0x4(%esp),%ecx %ecx= %esp+4, %ecx-4=%esp %ecx = init_%esp + 4 (%ecx) = normally, the 1st argument of a function 4: and $0xfffffff0,%esp %esp = %esp & 0xFFFFFFF0 make zero the least 4-bits of %esp new %esp : the 16-byte alignment of %esp 7: pushl -0x4(%ecx) push [%ecx-4]........................ (%esp -= 4) push [init_%esp], data where init_%esp points to push once more the return address previously, stored at the unaligned init_%esp now, also stored at the 16-byte aligned new %esp Young W. Lim Link 2. Object Files 2017-09-23 Sat 27 / 40

(2) Function Prologue a: push %ebp push %ebp.............................(%esp -= 4) push init_%ebp (init_%ebp address) after the aligned %esp, %ebp is stored on the stack b: mov %esp,%ebp %ebp= %esp new %ebp = %esp (aligned %esp) the base of the new stack frame is the aligned %esp d: push %ecx push %ecx.............................(%esp -= 4) push init_%esp+4 (address init_%esp +4) %ecx points to the unaligned stack top +4 e: sub $0x4,%esp %esp -= 4 alloc local var s..................... (%esp -= 4) enlarge %esp by 4 Young W. Lim Link 2. Object Files 2017-09-23 Sat 28 / 40

(3) Function Call 11: call 12 <main+0x12> 16: add $0x4,%esp %esp += 4 dealloc local variabls.............(%esp += 4) shrink %esp by 4 19: xor %eax,%eax %eax= 0 return value %eax= 0 return zero Young W. Lim Link 2. Object Files 2017-09-23 Sat 29 / 40

(4) Function Epilogue 1b: pop %ecx pop %ecx.............................(%esp += 4) pop init_%esp+4 (address init_%esp+4) now %ecx points to the unaligned stack top +4 1c: pop %ebp pop %ebp.............................(%esp += 4) pop init_%ebp (init_%ebp address) restore init_%ebp 1d: lea -0x4(%ecx),%esp %esp= %ecx-4 = (init_%esp+4)-4 %esp= init_%esp (int_%esp unaligned address) restore init_%esp 20: ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 30 / 40

swap assembly code analysis (1) readelf -s p 53: 0804a020 4 OBJECT GLOBAL DEFAULT 25 p0 64: 0804a018 8 OBJECT GLOBAL DEFAULT 25 buf 67: 0804a028 4 OBJECT GLOBAL DEFAULT 26 p1 0x804a028 0x804a024 0x804a020 p1 p0 0x804a01c buf[ 1 ] 0x804a018 buf[ 0 ] Young W. Lim Link 2. Object Files 2017-09-23 Sat 31 / 40

swap assembly code analysis (2) initialized global variable is in.data readelf -x.data p 0x0804a010 00000000 00000000 01000000 02000000 0x0804a020 18a00408 0x804a018 0x804a01c 0x804a020 0x00000001 0x00000002 0x0804a018 0x804a028 0x804a024 0x804a020 p1 p0 = 0x08094a018 0x804a01c buf[ 1 ] = 2 0x804a018 buf[ 0 ] = 1 Young W. Lim Link 2. Object Files 2017-09-23 Sat 32 / 40

swap assembly code analysis (3) 0: mov 0x0,%eax................ 0x804a020 mov M[0x804a020], %eax %eax= M[0x804a020] %eax= p0 (address) 5: mov 0x4,%ecx................ 0x804a01c mov M[0x804a01c], %ecx %ecx= M[0x804a01c] %ecx= buf[ 1 ] (integer) b: movl $0x4,0x0................ 0x804a01c, 0x804a028 movl $0x804a01c, M[0x804a028] M[0x804a028] = 0x804a01c p1 = buf+1 Young W. Lim Link 2. Object Files 2017-09-23 Sat 33 / 40

swap assembly code analysis (4) %eax = p0 = 0x0804a018 (address) %ecx = buf[ 1 ] = 2 (integer) p1 = buf + 1 = 0x804a01c (address) 0x804a028 0x804a024 0x804a020 p1 = 0x0804a01c p0 = 0x0804a018 0x804a01c buf[ 1 ] = 2 0x804a018 buf[ 0 ] = 1 Young W. Lim Link 2. Object Files 2017-09-23 Sat 34 / 40

swap assembly code analysis (5) swap( (%eax), {0x4}) 15: mov (%eax),%edx mov M[ M[0x804a020] ], %edx %edx= M[ M[0x804a020] ] = M[0x804a018] = 1 tmp = *p0; 17: mov %ecx,(%eax) mov M[0x804a01c], (%eax) M[ M[0x804a020] ] = M[0x804a018] = M[0x804a01c] = 2 *p0 = buf[ 1 ]; 19: mov %edx,0x4............... 0x804a01c mov %edx, M[0x804a01c] M[0x804a01c]= %edx buf[ 1 ] = tmp 1f: ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 35 / 40

relocatable objdump -d main.o main.o: formato del fichero elf32-i386 Desensamblado de la sección.text.startup: 00000000 <main>: 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 51 push %ecx e: 83 ec 04 sub $0x4,%esp 11: e8 fc ff ff ff call 12 <main+0x12> 16: 83 c4 04 add $0x4,%esp 19: 31 c0 xor %eax,%eax 1b: 59 pop %ecx 1c: 5d pop %ebp 1d: 8d 61 fc lea -0x4(%ecx),%esp 20: c3 ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 36 / 40

relocatable objdump -d swap.o swap.o: formato del fichero elf32-i386 Desensamblado de la sección.text: 00000000 <swap>: 0: a1 00 00 00 00 mov 0x0,%eax 5: 8b 0d 04 00 00 00 mov 0x4,%ecx b: c7 05 00 00 00 00 04 movl $0x4,0x0 12: 00 00 00 15: 8b 10 mov (%eax),%edx 17: 89 08 mov %ecx,(%eax) 19: 89 15 04 00 00 00 mov %edx,0x4 1f: c3 ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 37 / 40

executable objdump -d p (disassemble) - main 080482e0 <main>: 80482e0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80482e4: 83 e4 f0 and $0xfffffff0,%esp 80482e7: ff 71 fc pushl -0x4(%ecx) 80482ea: 55 push %ebp 80482eb: 89 e5 mov %esp,%ebp 80482ed: 51 push %ecx 80482ee: 83 ec 04 sub $0x4,%esp 80482f1: e8 0a 01 00 00 call 8048400 <swap> 80482f6: 83 c4 04 add $0x4,%esp 80482f9: 31 c0 xor %eax,%eax 80482fb: 59 pop %ecx 80482fc: 5d pop %ebp 80482fd: 8d 61 fc lea -0x4(%ecx),%esp 8048300: c3 ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 38 / 40

executable objdump -d p (disassemble) - swap 08048400 <swap>: 8048400: a1 20 a0 04 08 mov 0x804a020,%eax 8048405: 8b 0d 1c a0 04 08 mov 0x804a01c,%ecx 804840b: c7 05 28 a0 04 08 1c movl $0x804a01c,0x804a028 8048412: a0 04 08 8048415: 8b 10 mov (%eax),%edx 8048417: 89 08 mov %ecx,(%eax) 8048419: 89 15 1c a0 04 08 mov %edx,0x804a01c 804841f: c3 ret Young W. Lim Link 2. Object Files 2017-09-23 Sat 39 / 40

executable objdump -d p (disassemble) - section summary./p: formato del fichero elf32-i386 Desensamblado de la sección.init:... 0804828c <_init>: Desensamblado de la sección.plt:... 080482b0 < libc_start_main@plt-0x10>: 080482c0 < libc_start_main@plt>: Desensamblado de la sección.plt.got:... 080482d0 <.plt.got>: Desensamblado de la sección.text:... 080482e0 <main>: 08048301 <_start>: 08048330 < x86.get_pc_thunk.bx>: 08048340 <deregister_tm_clones>: 08048370 <register_tm_clones>: 080483b0 < do_global_dtors_aux>: 080483d0 <frame_dummy>: 08048400 <swap>: 08048420 < libc_csu_init>: 08048480 < libc_csu_fini>: Desensamblado de la sección.fini:... 08048484 <_fini>: Young W. Lim Link 2. Object Files 2017-09-23 Sat 40 / 40