embeddedarmdev
embeddedarmdev
  • 14
  • 174 773
Introduction to ELF Program Headers
This is an introduction to the Linux ELF program headers and segments.
Errata: At 11:00 I say the "index of the load section". It should be "index of the load segment"
มุมมอง: 473

วีดีโอ

Exploring the Linux ELF Section Header
มุมมอง 2.2Kปีที่แล้ว
In this video, I explore the structure of the Linux ELF section header.
Exploring the Linux ELF File Header
มุมมอง 2.6Kปีที่แล้ว
In this video, I explore the structure of the Linux ELF file header. Errata: at 18:58 I say that byte 34 is the last byte of the file header. This is incorrect. The size is of the file header is 0x34 bytes so the first byte would be byte 0x0 and the last byte would be the '00' at 0x33.
Introduction to the Linux ELF file.
มุมมอง 11K2 ปีที่แล้ว
This is an introduction to the Linux ELF (Executable and Linkable Format) file. It covers the types of ELF files and the basic structure including the file header, section headers, program headers, sections, and segments.
Cross-compile libraries on Linux - part 2 of 2
มุมมอง 7K3 ปีที่แล้ว
In this video, I give a practical demonstration for how to cross-compile libraries on Linux. It shows how to cross-compile zlib and openssl (with zlib compression). This is part 2 of a two-part set. First video: th-cam.com/video/IjhscBXr_Ic/w-d-xo.html
Cross-compile libraries on Linux - part 1 of 2.
มุมมอง 10K3 ปีที่แล้ว
In this video, I give background information for configuring, cross-compiling, and installing libraries on a Linux host for an ARM target. This video is part 1 of a two-part set. Make sure to check out part 2 for a practical demonstration. Part 2: th-cam.com/video/F1bdBzeEFw4/w-d-xo.html
Creating and Linking Shared Libraries on Linux with gcc
มุมมอง 22K4 ปีที่แล้ว
This video gives an introduction to creating shared libraries and linking with them when compiling executable binaries. It also provides some useful information on compiling position-independent code (pic) and naming conventions for shared libraries.
Creating and Linking Static Libraries on Linux with gcc
มุมมอง 31K4 ปีที่แล้ว
This video gives an introduction to static libraries. It will show you how to create static libraries on Linux using gcc and how to correctly link with them when compiling. One thing is not clearly stated in the video is that when linking statically using the -static option, the linker will look for a static archive (.a) file for the specified library. In some cases, only a shared library (.so)...
Static and Dynamic Linking on Linux with gcc
มุมมอง 46K4 ปีที่แล้ว
This video explains details for how static and dynamic linking works on Linux systems when compiling with GCC. One thing not mentioned in the video is that when linking statically using the -static option, the linker will look for a static archive (.a) file. For example, when linking statically with libc, it will look for libc.a instead of libc.so. You won't be able to link statically unless th...
Introduction to Compiling for Linux with gcc
มุมมอง 24K4 ปีที่แล้ว
This video introduces the basic concepts of compiling using the GNU toolchain (gcc) on Linux.
Install pre-compiled ARM cross-compiler onto Ubuntu Linux.
มุมมอง 19K4 ปีที่แล้ว
Tutorial for setting up pre-compiled ARM cross-compiler on Ubuntu Linux. One thing I didn't mention in the video. You can install (using apt) C and 64-bit cross-compilers with these packages: g -arm-linux-gnueabi (32-bit ARM cross-compiler for C ) g -arm-linux-gnueabihf (32-bit ARM cross-compiler for C with hardware float) gcc-aarch64-linux-gnu (64-bit ARM C cross-compiler for C) g -aarch64-lin...
Set up Ubuntu Linux VM in VirtualBox.
มุมมอง 2704 ปีที่แล้ว
A tutorial for setting up an Ubuntu Linux VM in VirtualBox. Note: In the video, I suggest a size of 10GB for the virtual disk image (vdi). After installing a number of development tools like cross-compilers and JDK, you may find that you are quickly running out of space. You may want to set a larger size for the vdi, like 20-30 GB. www.virtualbox.org/ ubuntu.com/
Install VirtualBox on Windows.
มุมมอง 5574 ปีที่แล้ว
Tutorial for installing VirtualBox on Windows.
Install VirtualBox on Ubuntu Linux
มุมมอง 1704 ปีที่แล้ว
A tutorial on how to install VirtualBox onto an Ubuntu Linux host using command line.

ความคิดเห็น

  • @Crux161
    @Crux161 17 ชั่วโมงที่ผ่านมา

    That mouse wheel is killing me 😅

    • @embeddedarmdev
      @embeddedarmdev 17 ชั่วโมงที่ผ่านมา

      It's to help keep you awake.

  • @HarmanKumar-x2z
    @HarmanKumar-x2z 19 วันที่ผ่านมา

    life saving , fantastic and simply genius

  • @mdhasnain_3764
    @mdhasnain_3764 23 วันที่ผ่านมา

    i paid 20 lakhs in clg and yet my prof couldn't match the level of clarity provided here.

  • @zeinbarhoum
    @zeinbarhoum 24 วันที่ผ่านมา

    That's actually very well explained, thank you!

  • @vasogagnidze3325
    @vasogagnidze3325 หลายเดือนก่อน

    спасибо

  • @MxSmack
    @MxSmack หลายเดือนก่อน

    This is an amazing resource, it's explained very carefully and considers beginners too. Thank you for taking the time to explain and share this, it's hard to find good resources to explain more complex computer science topics.

  • @embeddedarmdev
    @embeddedarmdev 2 หลายเดือนก่อน

    Here is something I would like to point out that I did not really mention in the video. In this video, I only created a static library, I did not create a corresponding shared library (.so) for this library. As a result of this, the only possibility for linking the code from libmath is statically. The default behavior for the linker is to link dynamically and will therefore look for the shared library first, libmath.so in this example. Since the shared library did not exist, it then looked for the static version (libmath.a) and since it found it, it compiled the libmath code into the binary statically. Now, if I had created both a static (libmath.a) and shared library (libmath.so), then the default would have been to compile it dynamically. It would have looked for and found the libmath.so and then that code would have been compiled in dynamically. In this case, when both static/dynamic libraries exist, in order to force it to go static, you have to include the 'static' keyword. This will look only for the libmath.a and will only be successful if it exists. Incidentally, you can use the -Wl option to pass the -Bstatic and -Bdynamic options to the linker to toggle back and forth between static and dynamic linking. So, if you have the following gcc command: gcc test.c -o test -Wl,-Bstatic -lfoo -Wl,-Bdynamic -lbar All code from libfoo would be compiled statically and all code from libbar would be dynamically linked. There would need to be a libfoo.a and a libbar.so for this to be successful. Also note that any libc code would be compiled based on the final -WL, -Boption that is on the command line. If we do this gcc test.c -o test -Wl,-Bstatic -lfoo Then both libfoo and libc would be compiled in statically, so make sure to add the final -Wl,-Bdynamic option to switch it back to the default.

  • @Qwerty_945
    @Qwerty_945 2 หลายเดือนก่อน

    Hey Sir ! what is -lmath ?

    • @embeddedarmdev
      @embeddedarmdev 2 หลายเดือนก่อน

      The -l option (lowercase L) tells gcc that we want to link to a specific library. The convention is to use the name of the library, without the 'lib' prefix. So, if we have a library called libmath, then we drop the 'lib' part of it to get just 'math'. Then we append that to the -l to get: -lmath In this video, libmath is the static library that I created in the first half of the video using the 'ar' command.

  • @SajiSNairNair-tu9dk
    @SajiSNairNair-tu9dk 3 หลายเดือนก่อน

    🤔

  • @samadinizar1244
    @samadinizar1244 3 หลายเดือนก่อน

    welcome back sir, rich video well explained as usual.

  • @HarshilKaneriaBCS
    @HarshilKaneriaBCS 3 หลายเดือนก่อน

    Do you have similar cross compiler for riscv32 CPU ? can you please share commands to install?

  • @cybernit3
    @cybernit3 3 หลายเดือนก่อน

    Thanks embeddeddarmdev. I tested it out and worked fine.

  • @udhayn822
    @udhayn822 3 หลายเดือนก่อน

    your explanation is really good, please make video on GOT and PLT.

  • @charliebrewis1158
    @charliebrewis1158 4 หลายเดือนก่อน

    This video is exactly what I've been looking for!

  • @CosmJJ
    @CosmJJ 4 หลายเดือนก่อน

    best videos on these topics! Thanks a lot!

  • @CODFactory
    @CODFactory 4 หลายเดือนก่อน

    I am really glad that you are back, if you get time ,can you also make videos on how symbol tables work and how they look like in case of static, dynamic lib etc etc?

    • @embeddedarmdev
      @embeddedarmdev 4 หลายเดือนก่อน

      Thanks for your support. Yes, I do plan to do some videos like that in the future.

  • @javipy2731
    @javipy2731 5 หลายเดือนก่อน

    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?

    • @embeddedarmdev
      @embeddedarmdev 5 หลายเดือนก่อน

      Thanks for your comments. This is a good question; probably worthy of an entire video in response. Linux makes use of something called virtual memory management. From the processes point of view, it has access to the full process address space allocated to it. Another process would think it has access to the exact same address range. But these addresses do not translate directly to the physical RAM address space. The process memory is logically split into pages of a certain size and the physical RAM is also split into page frames of the same size. The Linux OS will map a process's page to a page frame in physical RAM. So, when the process is accessing a page in its own process memory space, the OS will look up the physical RAM page frame that it maps to and read the data from there. This process page to RAM page frame mapping is called a page table. Generally processes have to share the physical RAM. So, when a process needs data that is not currently in RAM, and assuming RAM is full, the OS will need to make space, so it will write data from a RAM page frame into a temporary non-volatile storage. Then it will repurpose that physical page frame for the new process. Most Linux systems will have a partition called the swap partition. This is where data from RAM is written to and read from in order help facilitate RAM sharing. There is a lot to this topic, but I hope this explanation helps you understand it. Please ask again if it is not clear. Here's a link with some info: tldp.org/LDP/sag/html/vm-intro.html#:~:text=Linux%20supports%20virtual%20memory%2C%20that,be%20used%20for%20another%20purpose. This link has a diagram which I think is useful (see Section 3.) tldp.org/LDP/tlk/mm/memory.html

  • @wirion
    @wirion 5 หลายเดือนก่อน

    Fantastically well explained! I love that it doesn't skimp on the details.

    • @embeddedarmdev
      @embeddedarmdev 5 หลายเดือนก่อน

      Thanks. I'm glad you found it useful.

  • @youssefsamir9119
    @youssefsamir9119 5 หลายเดือนก่อน

    I'm very happy you're back!!

    • @kenrod6643
      @kenrod6643 5 หลายเดือนก่อน

      I second this.

    • @embeddedarmdev
      @embeddedarmdev 5 หลายเดือนก่อน

      It's been too long. I'm glad to be back to making videos.

    • @youssefsamir9119
      @youssefsamir9119 5 หลายเดือนก่อน

      @@embeddedarmdev bro I’ve watched your videos multiple times and I was saddened to see that you didn’t post anymore, but Welcome back!!

  • @arthurshau3277
    @arthurshau3277 5 หลายเดือนก่อน

    One very minor correction: At 18:52, when discussing the ELF File Header size, you mention that the very last byte of the file header is the ‘01’ at address byte 0x34. However, i think the last byte is actually one byte before, at 0x33. 0x34 describes the length, but since we start at 0, we need to subtract 1 to get the last byte. Not a big deal - and thank you for all of these informative videos; they’ve really helped me a lot.

    • @embeddedarmdev
      @embeddedarmdev 5 หลายเดือนก่อน

      You are correct. The last byte is 0x33, not 0x34. Unfortunately, TH-cam does not support annotations anymore so I pointed out the error in the description.

    • @arthurshau3277
      @arthurshau3277 5 หลายเดือนก่อน

      @@embeddedarmdev Ah I didn’t notice - I have a bad habit of forgetting to check descriptions. Cheers

    • @embeddedarmdev
      @embeddedarmdev 5 หลายเดือนก่อน

      No, you're good. I updated the description after you pointed out the error. Thanks for bringing it to my attention.

  • @Random-sm5gi
    @Random-sm5gi 5 หลายเดือนก่อน

    Very informative. Thanks boss.

  • @Popart-xh2fd
    @Popart-xh2fd 6 หลายเดือนก่อน

    27:34 Why didn't you chose *linux-x86_64*?

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      The tuple I am discussing here is for the target machine, not your host. So, you want to choose the architecture that the binary is expected to run on. In this video, we are compiling for an ARM processor, so I chose an ARM tuple.

    • @Popart-xh2fd
      @Popart-xh2fd 6 หลายเดือนก่อน

      @@embeddedarmdev Ok, I see, like compiling for a raspberry pi. Is that I was expecting to see you using the library with some examples and not just compiling it. Thanks for the videos.

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Yes, that is correct. So for the Raspberry Pi, you might choose linux-armv4 for a 32-bit Pi and linux-aarch64 for a 64-bit Pi (assuming they are running Linux). One thing I should also add is that the tuples you see in this video are what the Config utility is set up to use for this particular library (SSL). We see linux-armv4, so that would support armv4 instructions and would run on any processor that supports armv4 - armv7 since they are backwards compatible. Other libraries you find might use armv5 or higher. It just depends on the library. This video was focused specifically on cross-compiling a library, not really how to use a specific library in your code. The idea was to walk you through how to set up the configuration and specify all of the compiler options, include directories, library directories, etc. in order to cross-compile a library for some other architecture.

  • @samarthtandale9121
    @samarthtandale9121 6 หลายเดือนก่อน

    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!

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      I appreciate your support. I'm a big advocate of free education and I don't want to limit access to only those that have money, so I chose this platform. I have considered starting up a Patreon, but I don't do enough content to warrant that. Perhaps in the future I will set one up. I do make some money off the ads. If you want to help, the best thing you can do is spread the word about my channel and encourage people to check it out.

  • @samarthtandale9121
    @samarthtandale9121 6 หลายเดือนก่อน

    Wow! This series is increadible! Thank you so much, you are a life savior!

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Thank you. I'm glad you find the videos useful.

  • @samarthtandale9121
    @samarthtandale9121 6 หลายเดือนก่อน

    If you compile using -g option, then would it still fold the constant and avoid using the libm shared library? Just asking, because I think -g disables many compiler optimizations, that's why 😅

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      I'm not sure I understand your question. I don't know what you mean by "fold the constant". The -g option puts debugging information into the ELF, but does not change how the binary is linked. If your program uses an external library, you'll still have to link using the -l option. Does that answer your question?

  • @ThInGs-CrAzY-iy6dj
    @ThInGs-CrAzY-iy6dj 6 หลายเดือนก่อน

    make one for section ,training wheel.

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Thanks for your comment. I do have this video here on sections th-cam.com/video/L9okXJH5l2Y/w-d-xo.html Is there something specific about sections you are looking for? I can add it to my list of future content.

  • @edwardbanner1117
    @edwardbanner1117 6 หลายเดือนก่อน

    This is incredible 😍

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Thanks. I'm glad you like it. Hope you found it useful.

  • @edwardbanner1117
    @edwardbanner1117 6 หลายเดือนก่อน

    Amazing video! This video is so cool. Seriously. For exploring the object file, you could have used objdump

  • @mori7423
    @mori7423 6 หลายเดือนก่อน

    Is it possible to compile into a universal ELF file for both x86_64 and aarch64? So that we have a single universal ELF executable for both platforms? I think it is but I am not sure on how I can create such a universal binary.

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Yes, I believe it is possible. There is something called FatELF that does that, but I have not explored it mush. I'm not sure what your use case for this is, but it may not be as portable as you are hoping. I am pretty sure it requires you to make a modification to your target system to support it and I am not sure which distros (if any) would support it out of the box. So, I don't think it is like you can just distribute this binary and it would work an anybody's system. One thing to consider is that your binary would be roughly twice the size as for just one architecture which could be a problem for embedded systems. I think it just makes more sense to compile a separate binary for each target, but I guess it depends on your use case.

    • @mori7423
      @mori7423 6 หลายเดือนก่อน

      @@embeddedarmdev thank you for the response, I have already found out about FatELF, somehow I was under impression that ELF format is similar to Apple's universal binaries. I am doing some research for my thesis work and I am looking into malware samples that can be universally executed on both aarch64 and x86_64 as we have such issue on MacOS for Apple Silicon. Anyway, thank you for your videos, they are quite useful <3

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      I see. That's an interesting thesis. I was looking at it from a development perspective. It's definitely possible to do that but I think either the loader would have to support it, or you'd have to trick the loader somehow.

  • @jiaguo9323
    @jiaguo9323 7 หลายเดือนก่อน

    This is such a great series which covers an intersection area of compilers, computer architecture, linker and dynamic/static library. It was one of the very few inspiring videos on this topic: I do like the clear concept explanation and self illustration demo session. Looking forward more videos from you !

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Thank you. I'm glad you find them useful. I'm hoping to get back to making new videos very soon.

  • @greydogyoutube
    @greydogyoutube 7 หลายเดือนก่อน

    Finally! Thnaks a lot man!

  • @lilushan1
    @lilushan1 7 หลายเดือนก่อน

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

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      It would depend on what error it gave you. But I do know if you want to compile static, you need the static library (.a). You can't compile a static binary with a shared library (.so)

  • @maso553
    @maso553 7 หลายเดือนก่อน

    Hi where did you go?

  • @syedathahaseen3296
    @syedathahaseen3296 8 หลายเดือนก่อน

    Perfect..Thanks helped alot

  • @dantesalighieri
    @dantesalighieri 8 หลายเดือนก่อน

    These videos are diamonds. Sadly the website mentioned at the bottom is no longer available.

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Yes, sorry, I let the domain expire. But I have renewed it. However, all it ever did was redirect to my TH-cam page. I hope to add actual content sometime in the future.

  • @cryptobits229
    @cryptobits229 9 หลายเดือนก่อน

    Wow... This is the best video. I was exhausted reading for this thing. Thanks man

  • @MrMKA2012
    @MrMKA2012 9 หลายเดือนก่อน

    Your explanation of reflect deep understanding of the topic, thank you for your effort.

  • @igorpupkinable
    @igorpupkinable 9 หลายเดือนก่อน

    Great videos on the subject!

  • @igorpupkinable
    @igorpupkinable 9 หลายเดือนก่อน

    Great videos for a newbie. Thank you so much! Does GCC always link .a (archives) statically and .so (shared libraries) dynamically? I feel I am missing something because doMath compile commands seems to be the same in both videos except the order of -lmath parameter.

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Yes, if you compile with the static flag, it will look for the .a file. Otherwise it looks for the .so If you try compiling for static and don't have the .a library, I believe it throws an error.

  • @bautista5890
    @bautista5890 10 หลายเดือนก่อน

    Pretty useful video, cleared lots of questions I had, thanks a lot!

  • @youchialiu2599
    @youchialiu2599 11 หลายเดือนก่อน

    It really helps🥹🥹🥹🥹🥹

  • @uaman11
    @uaman11 11 หลายเดือนก่อน

    thank you for not talking slow af hahah

  • @zlatkogjuroski3235
    @zlatkogjuroski3235 11 หลายเดือนก่อน

    Hi , any new videos on ELF?

  • @giveaway4002
    @giveaway4002 11 หลายเดือนก่อน

    awesome video

  • @shashikantjagtap7255
    @shashikantjagtap7255 11 หลายเดือนก่อน

    Hello, first of all thank you for creating such an amazing video for cross compilation. My query is: I'm trying to build openssl for QNX7.1 target and ARM architecture. Which cross-compile-prefix should I use?

  • @gattomiaomiao9634
    @gattomiaomiao9634 ปีที่แล้ว

    I love your way of teaching, theory plus practical demonstrations are great

  • @gattomiaomiao9634
    @gattomiaomiao9634 ปีที่แล้ว

    this is so well done, thanks!!

  • @SLemmink
    @SLemmink ปีที่แล้ว

    Awesome job with the video. Thank you for your time and effort, this helped me out a lot as a newer SW engineer :)

  • @Debjit625
    @Debjit625 ปีที่แล้ว

    Thank you so much for these videos really appreciate your contents 😀

  • @moebuta5250
    @moebuta5250 ปีที่แล้ว

    this video is very informative, accurate and interesting , big thanks!

    • @embeddedarmdev
      @embeddedarmdev 6 หลายเดือนก่อน

      Thanks. Glad you found it useful!