SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
The Linker
  Common Issues
General wisdom
Read ld.so.1(1)
Verify your
assumptions
What does the linker do?



Combine an executable and shared
libraries to a runnable entity
How does it work?
                          (a bit simplified...)


This is runtime linking!
Look for wanted libs in NEEDED in the object
[1]     NEEDED          libcurses.so.1
[2]     NEEDED          libintl.so.8
[3]     NEEDED          libiconv.so.2



Search them in system dirs
  Default Library Path (ELF):   /lib:/usr/lib (system default)
  Trusted Directories (ELF):    /lib/secure:/usr/lib/secure (system default)


and RUNPATH
[10]    RUNPATH         /opt/csw/lib/$ISALIST:/opt/csw/lib
Getting the runpath in
      the binary
 Read ld(1)
 Always done during compile-time linking
 Option „-R <path>“
 LD_OPTIONS is processed before -R
   This can break testsuites
-R or LD_OPTIONS ?
-R in LDFLAGS
  Plays nice with applications
     If they honour LDFLAGS
  Multiple shell invocations may destroy
  $ISALIST
LD_OPTIONS
  Works always
  May confuse build of test apps as they link
  against installed libs instead of the newly
  build
$ISALIST
Dynamically expanded by ld.so.1, e.g.
sparcv9+vis2
sparcv9+vis
sparcv9
sparcv8plus+vis2
sparcv8plus+vis
sparcv8plus
sparcv8
sparcv8-fsmuld
sparcv7
sparc


See also isalist(1)
Debugging
        Static info from the binary

dump -Lv <binary>
dam@login [login]:/home/dam > dump -Lv /opt/csw/bin/bash

/opt/csw/bin/bash:

  **** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag         Value
[1]     NEEDED          libcurses.so.1
[2]     NEEDED          libintl.so.8
[3]     NEEDED          libiconv.so.2
[4]     NEEDED          libsocket.so.1
[5]     NEEDED          libnsl.so.1
[6]     NEEDED          libdl.so.1
[7]     NEEDED          libc.so.1
[8]     INIT            0xce204
[9]     FINI            0xce214
[10]    RUNPATH         /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib:/opt/csw/lib
[11]    RPATH           /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib:/opt/csw/lib
[12]    HASH            0x100e8
[13]    STRTAB          0x1c994
...




lari <binary>
Debugging
   Info from the running process

pldd
dam@login [login]:/home/dam > pldd $$
3838:   /opt/csw/bin/zsh
/opt/csw/lib/libgdbm.so.3.0.0
/opt/csw/lib/libpcre.so.0.0.1
/opt/csw/lib/libiconv.so.2.5.1
/lib/libsocket.so.1
/lib/libdl.so.1
/opt/csw/lib/libncursesw.so.5.9
/lib/libm.so.1
/lib/libc.so.1
/lib/libnsl.so.1
/platform/sun4v/lib/libc_psr.so.1
/opt/csw/lib/zsh/4.3.10/zsh/zle.so
AUXV linkage

Link option
         -f <filtee>
E.g. ld   -h libcurl.so.4 -f libcurl-feature.so.4 ...


How does it look in the binary?
[10]      SONAME         libcurl.so.4
[11]      AUXILIARY      libcurl-feature.so.4

Más contenido relacionado

La actualidad más candente

MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB
 
Talkaboutlithium
TalkaboutlithiumTalkaboutlithium
Talkaboutlithiumnoppoman722
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptKenny (netman)
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
 
Meet up symfony 16 juin 2017 - Les PSR
Meet up symfony 16 juin 2017 -  Les PSRMeet up symfony 16 juin 2017 -  Les PSR
Meet up symfony 16 juin 2017 - Les PSRJulien Vinber
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2Dvir Volk
 
Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Andrew Romanenco
 
Sample file processing
Sample file processingSample file processing
Sample file processingIssay Meii
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertorToshiaki Baba
 
Mito, a successor of Integral
Mito, a successor of IntegralMito, a successor of Integral
Mito, a successor of Integralfukamachi
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queueBrandon Lamb
 
Play with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniquePlay with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniqueAngel Boy
 

La actualidad más candente (20)

MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in Bavaria
 
Hypertable Nosql
Hypertable NosqlHypertable Nosql
Hypertable Nosql
 
Talkaboutlithium
TalkaboutlithiumTalkaboutlithium
Talkaboutlithium
 
Ruby meetup ROM
Ruby meetup ROMRuby meetup ROM
Ruby meetup ROM
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
 
Shell script-sec
Shell script-secShell script-sec
Shell script-sec
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
Android APP-toggle case
Android APP-toggle caseAndroid APP-toggle case
Android APP-toggle case
 
Elephants and Raft
Elephants and RaftElephants and Raft
Elephants and Raft
 
working with files
working with filesworking with files
working with files
 
Meet up symfony 16 juin 2017 - Les PSR
Meet up symfony 16 juin 2017 -  Les PSRMeet up symfony 16 juin 2017 -  Les PSR
Meet up symfony 16 juin 2017 - Les PSR
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2
 
Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.
 
Using Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibanaUsing Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibana
 
Sample file processing
Sample file processingSample file processing
Sample file processing
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Mito, a successor of Integral
Mito, a successor of IntegralMito, a successor of Integral
Mito, a successor of Integral
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
Play with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniquePlay with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit Technique
 
Createclone
CreatecloneCreateclone
Createclone
 

Destacado

Awesome text animations
Awesome text animationsAwesome text animations
Awesome text animationsd_boydst1
 
5MAllicivilization
5MAllicivilization5MAllicivilization
5MAllicivilizationgsbSS
 
Content based instruction
Content   based   instructionContent   based   instruction
Content based instructionAli Miri
 
Imkt120 padilla juan_unit1_ip
Imkt120 padilla juan_unit1_ipImkt120 padilla juan_unit1_ip
Imkt120 padilla juan_unit1_ipJuan Padilla
 
Taking good Photographs for you Media Coursework
Taking good Photographs for you Media CourseworkTaking good Photographs for you Media Coursework
Taking good Photographs for you Media Courseworkcarolinebirksatwork
 
5M Peyton Civilization
5M Peyton Civilization5M Peyton Civilization
5M Peyton CivilizationgsbSS
 
How do you enjoy sex with your back pains?
How do you enjoy sex with your back pains?How do you enjoy sex with your back pains?
How do you enjoy sex with your back pains?Louisehaker
 
Superant obstacles
Superant obstaclesSuperant obstacles
Superant obstaclescarmeo
 
Works cited page
Works cited pageWorks cited page
Works cited pageteaya
 
105 Tinamen Mountains
105 Tinamen Mountains105 Tinamen Mountains
105 Tinamen Mountainsiamthelegend
 
Module for principles and application of precision agriculture
Module for principles and application of precision agricultureModule for principles and application of precision agriculture
Module for principles and application of precision agricultureJAWI Herbs Centre
 
5S Alicia civilization
5S Alicia civilization5S Alicia civilization
5S Alicia civilizationgsbSS
 
5l Sophia Civilization
5l Sophia Civilization5l Sophia Civilization
5l Sophia CivilizationgsbSS
 
Why Marketing Plans are Important to growth
Why Marketing Plans are Important to growthWhy Marketing Plans are Important to growth
Why Marketing Plans are Important to growthCultivation LLC
 
Is 201 presentation_2_moore's_law[1]
Is 201 presentation_2_moore's_law[1]Is 201 presentation_2_moore's_law[1]
Is 201 presentation_2_moore's_law[1]skroh
 
Innovation and Risk - July 2014
Innovation and Risk - July 2014Innovation and Risk - July 2014
Innovation and Risk - July 2014Paul Iddon
 

Destacado (18)

Teamwork
TeamworkTeamwork
Teamwork
 
Awesome text animations
Awesome text animationsAwesome text animations
Awesome text animations
 
5MAllicivilization
5MAllicivilization5MAllicivilization
5MAllicivilization
 
Content based instruction
Content   based   instructionContent   based   instruction
Content based instruction
 
Imkt120 padilla juan_unit1_ip
Imkt120 padilla juan_unit1_ipImkt120 padilla juan_unit1_ip
Imkt120 padilla juan_unit1_ip
 
Taking good Photographs for you Media Coursework
Taking good Photographs for you Media CourseworkTaking good Photographs for you Media Coursework
Taking good Photographs for you Media Coursework
 
5M Peyton Civilization
5M Peyton Civilization5M Peyton Civilization
5M Peyton Civilization
 
How do you enjoy sex with your back pains?
How do you enjoy sex with your back pains?How do you enjoy sex with your back pains?
How do you enjoy sex with your back pains?
 
Superant obstacles
Superant obstaclesSuperant obstacles
Superant obstacles
 
Works cited page
Works cited pageWorks cited page
Works cited page
 
105 Tinamen Mountains
105 Tinamen Mountains105 Tinamen Mountains
105 Tinamen Mountains
 
Module for principles and application of precision agriculture
Module for principles and application of precision agricultureModule for principles and application of precision agriculture
Module for principles and application of precision agriculture
 
5S Alicia civilization
5S Alicia civilization5S Alicia civilization
5S Alicia civilization
 
5l Sophia Civilization
5l Sophia Civilization5l Sophia Civilization
5l Sophia Civilization
 
Why Marketing Plans are Important to growth
Why Marketing Plans are Important to growthWhy Marketing Plans are Important to growth
Why Marketing Plans are Important to growth
 
Is 201 presentation_2_moore's_law[1]
Is 201 presentation_2_moore's_law[1]Is 201 presentation_2_moore's_law[1]
Is 201 presentation_2_moore's_law[1]
 
Innovation and Risk - July 2014
Innovation and Risk - July 2014Innovation and Risk - July 2014
Innovation and Risk - July 2014
 
Huldy orjuela
Huldy orjuelaHuldy orjuela
Huldy orjuela
 

Similar a Linker Wisdom

LD_PRELOAD Exploitation - DC9723
LD_PRELOAD Exploitation - DC9723LD_PRELOAD Exploitation - DC9723
LD_PRELOAD Exploitation - DC9723Iftach Ian Amit
 
LinuxCon Japan 2010 suzaki
LinuxCon Japan 2010 suzakiLinuxCon Japan 2010 suzaki
LinuxCon Japan 2010 suzakiKuniyasu Suzaki
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
The true story_of_hello_world
The true story_of_hello_worldThe true story_of_hello_world
The true story_of_hello_worldfantasy zheng
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentMohammed Farrag
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ublnewrforce
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spackinside-BigData.com
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008guestd9065
 
Nix: What even is it though?
Nix: What even is it though?Nix: What even is it though?
Nix: What even is it though?Burke Libbey
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdockerJaehwa Park
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared librariesAcácio Oliveira
 
2.3 manage shared libraries
2.3 manage shared libraries2.3 manage shared libraries
2.3 manage shared librariesAcácio Oliveira
 
Oracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOsama Mustafa
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Tetsuyuki Kobayashi
 
Getting started with libfabric
Getting started with libfabricGetting started with libfabric
Getting started with libfabricJianxin Xiong
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practicesDaniel Pfeifer
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomValeriy Kravchuk
 
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Jennifer Shelton
 

Similar a Linker Wisdom (20)

LD_PRELOAD Exploitation - DC9723
LD_PRELOAD Exploitation - DC9723LD_PRELOAD Exploitation - DC9723
LD_PRELOAD Exploitation - DC9723
 
LinuxCon Japan 2010 suzaki
LinuxCon Japan 2010 suzakiLinuxCon Japan 2010 suzaki
LinuxCon Japan 2010 suzaki
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
The true story_of_hello_world
The true story_of_hello_worldThe true story_of_hello_world
The true story_of_hello_world
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
Nix: What even is it though?
Nix: What even is it though?Nix: What even is it though?
Nix: What even is it though?
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
 
2.3 manage shared libraries
2.3 manage shared libraries2.3 manage shared libraries
2.3 manage shared libraries
 
Oracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLink
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'
 
Getting started with libfabric
Getting started with libfabricGetting started with libfabric
Getting started with libfabric
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
 
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
 
Php logging
Php loggingPhp logging
Php logging
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Linker Wisdom

  • 1. The Linker Common Issues
  • 3. What does the linker do? Combine an executable and shared libraries to a runnable entity
  • 4. How does it work? (a bit simplified...) This is runtime linking! Look for wanted libs in NEEDED in the object [1] NEEDED libcurses.so.1 [2] NEEDED libintl.so.8 [3] NEEDED libiconv.so.2 Search them in system dirs Default Library Path (ELF): /lib:/usr/lib (system default) Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default) and RUNPATH [10] RUNPATH /opt/csw/lib/$ISALIST:/opt/csw/lib
  • 5. Getting the runpath in the binary Read ld(1) Always done during compile-time linking Option „-R <path>“ LD_OPTIONS is processed before -R This can break testsuites
  • 6. -R or LD_OPTIONS ? -R in LDFLAGS Plays nice with applications If they honour LDFLAGS Multiple shell invocations may destroy $ISALIST LD_OPTIONS Works always May confuse build of test apps as they link against installed libs instead of the newly build
  • 7. $ISALIST Dynamically expanded by ld.so.1, e.g. sparcv9+vis2 sparcv9+vis sparcv9 sparcv8plus+vis2 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc See also isalist(1)
  • 8. Debugging Static info from the binary dump -Lv <binary> dam@login [login]:/home/dam > dump -Lv /opt/csw/bin/bash /opt/csw/bin/bash: **** DYNAMIC SECTION INFORMATION **** .dynamic: [INDEX] Tag Value [1] NEEDED libcurses.so.1 [2] NEEDED libintl.so.8 [3] NEEDED libiconv.so.2 [4] NEEDED libsocket.so.1 [5] NEEDED libnsl.so.1 [6] NEEDED libdl.so.1 [7] NEEDED libc.so.1 [8] INIT 0xce204 [9] FINI 0xce214 [10] RUNPATH /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib:/opt/csw/lib [11] RPATH /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib:/opt/csw/lib [12] HASH 0x100e8 [13] STRTAB 0x1c994 ... lari <binary>
  • 9. Debugging Info from the running process pldd dam@login [login]:/home/dam > pldd $$ 3838: /opt/csw/bin/zsh /opt/csw/lib/libgdbm.so.3.0.0 /opt/csw/lib/libpcre.so.0.0.1 /opt/csw/lib/libiconv.so.2.5.1 /lib/libsocket.so.1 /lib/libdl.so.1 /opt/csw/lib/libncursesw.so.5.9 /lib/libm.so.1 /lib/libc.so.1 /lib/libnsl.so.1 /platform/sun4v/lib/libc_psr.so.1 /opt/csw/lib/zsh/4.3.10/zsh/zle.so
  • 10. AUXV linkage Link option -f <filtee> E.g. ld -h libcurl.so.4 -f libcurl-feature.so.4 ... How does it look in the binary? [10] SONAME libcurl.so.4 [11] AUXILIARY libcurl-feature.so.4