Skip to content

Dynamic-linking-ro.md : Fixed trailing `, added asterisk and other formatting issues #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: cdl-07
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Scooby-doo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions dynamic-linking.ro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Diferența este că acum, folosim linkare dinamică în loc de linkare statică
Pentru aceasta, am renunțat la argumentul `-static` folosit la linkare.

Pentru acest exemplu, obținem un singur executabil `main`, din legarea statică cu biblioteca `libinc.a` și legarea dinamică cu biblioteca standard C.
Similar exemplului din directorul `05-static/, folosim comanda `make` pentru a obține executabilul `main`:
Similar exemplului din directorul `05-static/,` folosim comanda `make` pentru a obține executabilul `main`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Similar exemplului din directorul `05-static/,` folosim comanda `make` pentru a obține executabilul `main`:
Similar exemplului din directorul `05-static/`, folosim comanda `make` pentru a obține executabilul `main`:


```console
[..]/06-dynamic$ ls
Expand Down Expand Up @@ -43,7 +43,7 @@ main: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically link

Fișierul executabil `main` obținut prin linkare dinamică are un comportament identic fișierului executabil `main` obținut prin linkare statică.
Observăm că dimensiunea sa este mult mai redusă: ocupă `7 KB` comparativ cu `600 KB` cât avea varianta sa statică.
De asemenea, folosind utilitarul `file`, aflăm că este executabil obținut prin linkare dinamică (*dynamically linked*), în vreme cel obținut în exemplul anterior este executabil obținut prin linkare statică (*statically linked).
De asemenea, folosind utilitarul `file`, aflăm că este executabil obținut prin linkare dinamică (*dynamically linked*), în vreme cel obținut în exemplul anterior este executabil obținut prin linkare statică (*statically linked*).

Investigăm simbolurile executabilului:

Expand All @@ -66,7 +66,7 @@ Investigăm simbolurile executabilului:

Simbolurile obținute din modulul obiect `main.o` și din biblioteca statică `libinc.o` sunt rezolvate și au adrese stabilite.
Observăm că folosirea bibliotecii standard C a dus la existența simboblului `_start`, care este entry pointul programului.
Dar, simbolurile din biblioteca standard C, (`printf`, __libc_start_main`) sunt marcate ca nedefinite (`U`).
Dar, simbolurile din biblioteca standard C, (`printf`, __libc_start_main) sunt marcate ca nedefinite (`U`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dar, simbolurile din biblioteca standard C, (`printf`, __libc_start_main) sunt marcate ca nedefinite (`U`).
Dar, simbolurile din biblioteca standard C, (`printf`, `__libc_start_main`) sunt marcate ca nedefinite (`U`).

Aceste simboluri nu sunt prezente în executabil: rezolvarea, stabilirea adreselor și relocarea lor se va realiza mai târziu, la încărcare (load time).

La încărcare, o altă componentă software a sistemului, loaderul / linkerul dinamic, se va ocupa de:
Expand All @@ -77,7 +77,7 @@ La încărcare, o altă componentă software a sistemului, loaderul / linkerul d

Putem investiga bibliotecile dinamice folosite de un executabil prin intermediul utilitarului `ldd`:

``console
```console
[..]/06-dynamic$ ldd main
linux-gate.so.1 (0xf7f97000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7d8a000)
Expand Down
9 changes: 9 additions & 0 deletions football.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Where are you Scooby-Doo? 🐶👻

![Scooby-Doo](./Scooby-doo.jpg)

Drop a like for my music [Scooby Jam](https://www.youtube.com/watch?v=776rvGHfzuM&pp=ygUQc2Nvb2J5IGRvbyBpbnRybw%3D%3D) pretty please <3




1 change: 1 addition & 0 deletions helloworld/helloworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
int main()
{
std::cout << "Hello, World!" << std::endl;
std::cout << "Nu mai pot ba frt" << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you, but remove this.

return 0;
}
1 change: 1 addition & 0 deletions helloworld/helloworld.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
print("Hello, World!")
print("Nu mai pot ba frt")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto: remove this.