Skip to content
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
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,17 @@ Create the `helloworld.md` file that will generate that precise GitHub view.
Make sure you do the following:

1. Start by creating a branch where you do your work.
Use `helloworld` for the branch name:

```console
git checkout -b helloworld
```

This will be the branch **from** where you will create a pull request.
As usual, the future pull request will target your assigned branch in the [upstream repository](https://github.com/rosedu/workshop-markdown).

1. Copy-paste contents from the PDF file.
Do not write programs by hand.
Open the `helloworld-print.pdf` file in a PDF viewer, select text, copy in the `helloworld.md` file.

1. Use correct syntax items for typewriter format, links to sections, code snippet format, tables.
See [the GitHub Markdown spec](https://github.github.com/gfm/).
Expand All @@ -195,21 +201,18 @@ Make sure you do the following:

After each push, check the GitHub view of the work branch in your fork of the GitHub repository.

1. After completing the task, submit the `helloworld.md` Markdown file as part of a pull request.

Follow the instructions above to create the pull request.
Make sure you have good commit messages and a good pull request description.
Check the contents of the `helloworld.md` file on your GitHub fork and see if it is now rendered correctly.

Target the pull request **to** your assigned branch.
1. After completing the task, submit the `helloworld.md` Markdown file as part of a pull request.

Ask the instructors to review your pull request.
Make updates as required.
Have your pull request approved and merged on top of your assigned branch.
Follow the instructions above to create the pull request.
Make sure you have good commit messages and a good pull request description.

Check the GitHub web view of the [upstream repository](https://github.com/rosedu/workshop-markdown) for your assigned branch.
Click on the button with `main` (the branch button) and select your branch.
Target the pull request **to** your assigned branch.

Check the contents of the `helloworld.md` file and see if it is now rendered correctly.
1. Ask the instructors to review your pull request.
Make updates as required.
Have your pull request approved and merged on top of your assigned branch.

### Clean Up After Pull Request

Expand Down
16 changes: 8 additions & 8 deletions dynamic-linking.ro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ 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`:

```console
```bash
[..]/06-dynamic$ ls
inc.c inc.h main.c Makefile

Expand All @@ -39,15 +39,15 @@ main: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically link

[..]/06-dynamic$ file ../05-static/main
../05-static/main: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=60adf8390374c898998c0b713a8b1ea0c255af38, not stripped
``
```

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:

```console
```bash
[..]/06-dynamic$ nm main
[...]
0804848c T increment
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).
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
```bash
[..]/06-dynamic$ ldd main
linux-gate.so.1 (0xf7f97000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7d8a000)
Expand Down Expand Up @@ -112,7 +112,7 @@ Pentru aceasta, construim fișierul bibliotecă partajată `libinc.so`, în locu

Similar exemplului din directorul `06-dynamic/`, folosim comanda `make` pentru a obține executabilul `main`:

```console
```bash
[..]/07-dynlib$ ls
inc.c inc.h main.c Makefile

Expand Down
Empty file added helloworld.md
Empty file.