Skip to content

Commit

Permalink
Merge pull request #746 from h4child/patch-1
Browse files Browse the repository at this point in the history
Update linux-bootstrap-4.md
  • Loading branch information
0xAX authored Nov 28, 2020
2 parents e68a4c3 + 26ad004 commit bc14eb6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Booting/linux-bootstrap-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ ENTRY(startup_32)
#define __HEAD .section ".head.text","ax"
```

Here, `.head.text` is the name of the section and `ax` is a set of flags. In our case, these flags show us that this section is [executable](https://en.wikipedia.org/wiki/Executable

In simple terms, this means that a Linux kernel with this option set can be booted from different addresses. Technically, this is done by compiling the decompressor as [position independent code](https://en.wikipedia.org/wiki/Position-independent_code). If we look at [arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/v4.16/arch/x86/boot/compressed/Makefile), we can see that the decompressor is indeed compiled with the `-fPIC` flag:
Here, `.head.text` is the name of the section and `ax` is a set of flags. In our case, these flags show us that this section is [executable](https://en.wikipedia.org/wiki/Executable). In simple terms, this means that a Linux kernel with this option set can be booted from different addresses. Technically, this is done by compiling the decompressor as [position independent code](https://en.wikipedia.org/wiki/Position-independent_code). If we look at [arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/v4.16/arch/x86/boot/compressed/Makefile), we can see that the decompressor is indeed compiled with the `-fPIC` flag:

```Makefile
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
Expand Down

0 comments on commit bc14eb6

Please sign in to comment.