Static and Dynamic Linking on Linux with gcc

Static and Dynamic Linking on Linux with gcc

embeddedarmdev

4 года назад

45,577 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@javipy2731
@javipy2731 - 17.04.2024 22:38

Great video, the deepest and best explanation I ever seen. However, I have a question. When you explained about the files with objdump, they show that symbols (functions in this case), have a fix direction in memory, haven't they. So every time the program (process) in load into memory, symbols are held in the same memory location? What happend if those directions are occupied by another process?

Ответить
@samarthtandale9121
@samarthtandale9121 - 15.03.2024 18:07

Though I am a student, how can I support your course by a little financial amount. It's soooo good, I don't wanna learn for free!

Ответить
@lilushan1
@lilushan1 - 01.02.2024 10:24

Great video. For me, -static gave me linking errors. What would be the reason?

Ответить
@samarthtandale9121
@samarthtandale9121 - 15.07.2023 20:09

why don't we need to link the libc ... like -lc or something?

Ответить
@arktessellator_10
@arktessellator_10 - 15.07.2023 16:44

Amazing explanation and demonstration with enough detail to have semi low level look on how linking takes place!

Ответить
@fatty-it-man
@fatty-it-man - 02.05.2023 16:09

Super good, deep and understandable

Ответить
@ravishankar7972
@ravishankar7972 - 18.04.2023 20:21

This is by far the best linker video! Kudos to you!

Ответить
@himanshusingh-sh7ih
@himanshusingh-sh7ih - 27.09.2022 16:51

Thanks a lot for making this video. Very detailed and precise at the same time. The best video one can create to explain Static and dynamic linking in detail.

Ответить
@artk505
@artk505 - 24.08.2022 17:38

Your vids are gold for C newbs like myself. Thank you sir!

Ответить
@govindarajuperumal7133
@govindarajuperumal7133 - 05.08.2022 12:53

This video is gold.

Ответить
@wsm4837
@wsm4837 - 11.07.2022 14:31

Excellent and well-presented video. Please upload more soon.

Ответить
@user-vr1ku3po8f
@user-vr1ku3po8f - 17.06.2022 21:22

I have seen many books and blogs about dll. This video illustrates the best.

Ответить
@zazem4835
@zazem4835 - 14.04.2022 21:33

I love u

Ответить
@AshishKumar-gl2ur
@AshishKumar-gl2ur - 11.03.2022 13:57

question: the maths library -- description did not have an interpretor entry, where as C-lib so had one. Both are .so. So is this interpretor entry in .so an optional thing?

Ответить
@andreicapi3535
@andreicapi3535 - 25.02.2022 17:09

very clear and easy to understand video thank you

Ответить
@bin4rym4ge
@bin4rym4ge - 22.02.2022 22:33

This is the most helpful video I've watched on the subject. It's helped me a lot thanks.

Ответить
@jamesmerkel1411
@jamesmerkel1411 - 07.02.2022 03:00

Thanks for this video. Very clear explanation of static and dynamic linking. Question: how do I set up the gcc command line to just statically link one library with the rest of the libraries dynamically linked? For example, I want to statically link libxml2, but dynamically link the c library. This would handle the case where a target machine doesn't have libml2 but does have the c library.

Ответить
@bibhusingh199
@bibhusingh199 - 07.01.2022 19:28

so usefull and easy to understand !! great job

Ответить
@digitallova
@digitallova - 03.01.2022 04:09

When static is the object file calling a pointer for the entry point of puts, time and so one?

Ответить
@binarytv2904
@binarytv2904 - 01.01.2022 17:47

Thank you so much...It was vry helpful!

Ответить
@SLTRM
@SLTRM - 31.12.2021 10:33

For the link process is relevant the order of -l params?. I had a project of c++ with cmake / qt and another libraries. With full static link. But when i change the order in cmake target_link_library, i get a lot of unresolv symbols error messsges from the linker. Only in one specific order in the static libraries list work. If you like i can share the git repo by this way.

Ответить
@mirzanasir5779
@mirzanasir5779 - 08.12.2021 05:13

Straight to the point with enough detail needed to understand ! Great !

Ответить
@tomjoad6993
@tomjoad6993 - 11.11.2021 01:37

Let's say you are trying to compile a program for two different Linux distros, Ubuntu 20.04 and Manjaro 20.2. And let's say the program is dynamically linked to a library that has a different name and location on each distro. How exactly do you specify the name and location when you are compiling for each distro?

Ответить
@parkeryan9672
@parkeryan9672 - 06.11.2021 05:18

Excelletn video, and hope you can make another video to explain more detail about how main find the real function of printf by plt, and more about the resolve function _dl_runtime_resolve

Ответить
@joanmihali8281
@joanmihali8281 - 11.10.2021 11:04

Excellent tutorial

Ответить
@z3jlewhhda376
@z3jlewhhda376 - 12.09.2021 02:31

Sir your content is amazing. I planned to watch all your playlist tonight

Ответить
@alice_in_wonderland42
@alice_in_wonderland42 - 12.08.2021 16:41

There is(maybe was) a bug in Libmagic which shows PIE as shared lib

Ответить
@greymind0072
@greymind0072 - 08.08.2021 20:45

This is really great, so clear and the help of small diagrams were really helpful. Even my university cannot do a better work in making student learn as you. thanks a lot for your work. Hope you will upload more soon

Ответить
@veerrajuannamdevula9939
@veerrajuannamdevula9939 - 28.07.2021 16:53

Sir,
Do all the functions code that is in header files get copied during static linking or only those functions which are called in our program get copied?

Ответить
@VuongNguyen-wr9hp
@VuongNguyen-wr9hp - 09.07.2021 08:01

Clean and clear, thank you. This is exactly what I've been looking for

Ответить
@akhileshkukreti6303
@akhileshkukreti6303 - 03.06.2021 21:13

Great Job, please keep it up, practical demo was awesome

Ответить
@uwuwgrhdhwj
@uwuwgrhdhwj - 18.05.2021 13:27

Very good video

Ответить
@binwei2829
@binwei2829 - 15.05.2021 20:39

Great video! I have a project using libusb-1.0. But after adding -no-pie to the compiling flag, I used your command to check

$ readelf -a myapp | grep Shared
0x0000000000000001 (NEEDED) Shared library: [libusb-1.0.so.0]

libusb is still dynamically linked, not static. Do you know why? Thanks!

Ответить
@shadowinlight20
@shadowinlight20 - 02.05.2021 15:29

Nice video. Keep posting!

Ответить
@otziotzi2157
@otziotzi2157 - 25.04.2021 10:06

Thanks for interesting video. I have one question. How does dynamic linker know if the shared library, which is used by the process which is being started, is already loaded somewhere into the memory (because other already running process is using it), or it is not yet in the memory? Does dynamic linker have some internal structure that it uses to record which shared library was already loaded to avoid attempt of loading it again? How this part work?

Ответить
@jonathanmoore5619
@jonathanmoore5619 - 11.04.2021 15:08

This is a great video. Good work. Hail Lobster 🦞.

Ответить
@SK-yn6tq
@SK-yn6tq - 04.04.2021 07:15

Very well done, thank you so much.

Ответить
@absentdead
@absentdead - 31.03.2021 22:23

extremely useful sir, thanks for sharing your knowledge

Ответить
@mohammadkhodabakhsh176
@mohammadkhodabakhsh176 - 28.03.2021 17:06

nice 👍👌

Ответить
@_atrocious_4622
@_atrocious_4622 - 21.03.2021 22:11

High quality educational vid, thank you sir.

Ответить
@miguelg.s.1246
@miguelg.s.1246 - 11.02.2021 19:43

Incredibly helpful! Just what I needed, great video!

Ответить
@chenyiaero
@chenyiaero - 22.01.2021 04:25

Great video 👍. Very informative.

Ответить
@arjunarangil3062
@arjunarangil3062 - 19.09.2020 13:55

really helpful.. guys you will get xtra knowledge

Ответить