Linkerandloader
Linkerandloader
Linkerandloader
Linker and Loader are the utility programs that plays a major role in the
execution of a program. The Source code of a program passes through
compiler, assembler, linker, loader in the respective order, before execution.
On the one hand, where the linker intakes the object codes generated by
the assembler and combine them to generate the executable module.
On the other hands, the loader loads this executable module to the main
memory for execution.
1
Linker and loader
2
C program compilation process
The C compiler, compiles the program and translates it to assembly program (low-level language).
An assembler then translates the assembly program into machine code (object)
A linker tool is used to link all the parts of the program together for execution (executable machine code).
A loader loads all of them into memory and then the program is executed.
3
Linker
The Assembler generates the object code of a source program and hands it
over to the linker. The linker takes this object code and generates the
executable code for the program, and hand it over to the Loader.
The high-level language, programs have some built-in libraries and header
files. The source program may contain some library functions whose
definition are stored in the built-in libraries. The linker links these function
to the built-in libraries. In case the built-in libraries are not found it informs
to the compiler, and the compiler then generates the error.
4
Sometimes the large programs are divided into the subprograms which are
called modules. Now when these modules are compiled and assembled, the
object modules of the source program are generated. The linker has the
responsibility of combining/linking all the object modules to generate a
single executable file of the source program.
5
We have two types of linkers:
6
Loader
As the program that has to be executed currently must reside in the main
memory of the computer. It is the responsibility of the loader, a program in
an operating system, to load the executable file/module of a program,
generated by the linker, to the main memory for execution. It allocates the
memory space to the executable module in main memory.
The operation of absolute loader is very simple. The object code is loaded to
specified locations in the memory. At the end the loader jumps to the specified
address to begin execution of the loaded program. The advantage of
absolute loader is simple and efficient. But the disadvantages are,the need
for programmer to specify the actual address, and, difficult to use subroutine
libraries.
Bootstrap Loader
When a computer is first turned on or restarted, a special type of absolute loader, called
bootstrap loader is executed. This bootstrap loads the first program to be run by the
computer--usually an operating system. The bootstrap itself begins at address 0. It loads
the OS starting address 0x80.No header record or control information, the object code
is consecutive bytes of memory.
8
Relocation Loader
The concept of program relocation is, the execution of the object
program using any part of the available and sufficient memory. The
object program is loaded into memory wherever there is room for it. The
actual starting address of the object program is not known until load
time. Relocation provides the efficient sharing of the machine with
larger memory and when several independent programs are to be run
together. It also supports the use of subroutine libraries efficiently.
Loaders that allow for program relocation are called relocating loaders or
relative loaders.
9
LINKER LOADER
1.The main function of Linker is to generate Whereas main objective of Loader is to
executable files. executable files to main memory.
2. The linker takes input of object code The loader takes input of executable files
generated by compiler/assembler. generated by linker.
3. Linking can be defined as process of Loading can be defined as process of
combining various pieces of codes and loading executable codes to main memory
source code to obtain executable code. for further execution.
4. Linker is of 2 types: Linkage Editor and Loader is of 3 types: Absolute loading,
Dynamic Linker. Relocatable loading and Dynamic run-time
loading.
5. Another use of linker is to combine all It helps in allocating the address to
object modules. executable codes/files.
6. Linker is also responsible for arranging Loader is also responsible for adjusting
objects in program’s address space. references which are used within the
program.
10
Generation of programming language
11
12
Programming languages have been developed over the year in a phased manner. Each phase
of developed has made the programming language more user-friendly, easier to use and
more powerful. Each phase of improved made in the development of the programming
languages can be referred to as a generation. The programming language in terms of their
performance reliability and robustness can be grouped into five different generations,
13
1. First Generation Language (Machine language):1GL
16
Advantages of third generation programming language
17
Fourth generation language (Very High-level Languages):4GL
The languages of this generation were considered as very high-level programming languages
Each of the programming language generations aims to provide a higher level of
abstraction of the internal computer hardware details, making the language more
programmer-friendly, powerful, and versatile. While the definition of 4GL has changed over
time, it can be typified by operating more with large collections of information at once
rather than focusing on just bits and bytes.
The fourth generation programming languages were designed and developed to reduce the
time, cost and effort needed to develop different types of software applications.
Languages claimed to be 4GL may include support for database management, report
generation, mathematical optimization, GUI development, or web development.
18
A number of different types of 4GLs exist:
•Report-generator programming languages take a description of the data format and the
report to generate and from that they either generate the required report directly or they
generate a program to generate the report.
•Similarly, forms generators manage online interactions with the application system users
or generate programs to do so.
•More ambitious 4GLs (sometimes termed fourth generation environments) attempt to
automatically generate whole systems from the outputs of CASE tools, specifications of
screens and reports, and possibly also the specification of some additional processing
logic.
Data management 4GLs such as SAS, SPSS, and Stata provide sophisticated coding
commands for data manipulation, file reshaping, case selection, and data
documentation in the preparation of data for statistical analysis and reporting.
19
Advantages of fourth generation languages
1. These programming languages allow the efficient use of data by
implementing the various database.
2. They require less time, cost and effort to develop different types of
software applications.
3. The program developed in these languages are highly portable as
compared to the programs developed in the languages of other
generation.
20
Fifth generation language (Artificial Intelligence Language):5GL
21
What Is the Difference Between 3GLs and 4GLs?
22
❑ The reduced complexity of fourth generation languages has also
increased the number of professionals who can take part in software
development. Most 4GLs are associated with data processing and
databases; they reflect the language used by domain professionals to
formulate business processing sequences and rules, thus facilitating the
efficient development of business-oriented systems. Most data-oriented
fourth-generation languages are SQL (Structured Query Language)
based. Java, C and C++ are common examples of third-generation
languages. High-level code is usually introduced to 4GLs in order to
introduce specific system logic.
23
Some high level programming language
1. Python
Python was first released in 1991 and created by Guido van Rossum. It’s the first love for any novice user since the
early 1980s. Python is one of the simplest languages considered to be a high-level, general-purpose interpreted
programming language.
This futuristic user-friendly programming language is fast to code and easy to learn.
According to a report from IEEE Spectrum, Python is a king for a majority of ranking metrics, and it reigns in the
enterprise, web, and embedded programming landscapes.
Advantage
Extensive library support
This versatile language is used to develop a
Object-oriented language
variety of applications. It offers a seamless
experience and is provided with endless
High-level language
possibilities to create the next big thing using User-friendly data structures
trending technologies like artificial Platform Independency
intelligence and machine learning. Presence of third-party modules
Open-source with the ever-growing popularity
Easy to learn
Offer the ability to develop a complex application
User-friendly data structures
Focuses on the code readability
24 Databases Connectivity
Application
Operating System Development
Web Framework and Web Application Development
Enterprise and business applications
For Prototyping
Graphical User Interface Desktop Application Development
For Game Development
Data Analysis
Image processing
Scientific Applications
25
2. Java
Being in the industry for years, it captures the developer’s attention. It first
appeared in 1995, with flexible options to run any browser window.
It was develop at sun microsystem by team lead by James Gosling
Application
Advantage Development of Operating System
C++ support rich function library
C++ support Multi-paradigm Development of Game
C++ is an Object-Oriented Programming Language
Low-level Manipulation
Development of Web Browser
Memory Management Compiler Development
Scalability
Large Community Support Development of Graphics
Support Cross-Platform Banking Application
The speed of execution is fast.
Development of Database Software
27
4. Javascript
Advantage
Javascript is a dynamic language that first Easy to learn
Client-Side Scripting Language
appeared in December 1995. It’s a It extended the functionality of
web page
prototype-based, multi-paradigm, powerful No Compilation is needed
Easy to debug and testing
language. Javascript supports object- Cross-platform Application
oriented, imperative, and declarative style by Speed is fast
Rich Interface
Web Application
Development
being the language of the web. Versatility Web Server Application
Rich Library
Development
It improves the possibility of data validation, Game Development using
ensuring no vulnerabilities. Javascript used HTML5
Mobile App Development
for both server-side and client-side Smart Watch Application
programming. Regular updates of this
language keep you updated and help you
meet market expectations.
28
TOP PROGRAMMING LANGUAGES
29
Machine independent and portability of a program
31
Portability is a characteristic attributed to a computer program if it can be used in an
operating systems other than the one in which it was created without requiring major
rework. Porting is the task of doing any work necessary to make the computer program
run in the new environment. In general, programs written in c language interface are
portable. Ideally, such a program needs only to be compiled for the operating system to
which it is being ported. However, programmers using standard interfaces also
sometimes use operating system extensions or special capabilities that may not be
present in the new operating system. Uses of such extensions have to be removed or
replaced with comparable functions in the new operating system. In addition to
language differences, porting may also require data conversion and adaptation to new
system procedures for running an application.
32