Last active
May 31, 2021 04:46
-
-
Save doug65536/c30e5cd55054cc717afd5bd72c622d21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doug@doug-dt:~/code/dgos/build$ g++ -nostdlib -Wl,-T,emb.ld emb.S -o emb -static -Wl,-no-build-id | |
/usr/bin/ld: warning: .note.gnu.build-id section discarded, --build-id ignored. | |
doug@doug-dt:~/code/dgos/build$ objdump -h emb | |
emb: file format elf64-x86-64 | |
Sections: | |
Idx Name Size VMA LMA File off Algn | |
0 .note.gnu.build-id 00000024 00000000ffe00000 00000000ffe00000 00200000 2**2 | |
CONTENTS, ALLOC, LOAD, READONLY, DATA | |
1 .text 00200000 00000000ffe00024 00000000ffe00024 00200024 2**0 | |
CONTENTS, ALLOC, LOAD, READONLY, CODE | |
doug@doug-dt:~/code/dgos/build$ cat emb.ld | |
/* -2M */ | |
. = 0xFFE00000; | |
SECTIONS { | |
/DISCARD/ : { *(.note.gnu.build-id); } | |
.text : { | |
*(.text); | |
. = (2<<20)-16; | |
. = .; | |
*(.text.entry); | |
. = 2<<20; | |
} | |
} | |
doug@doug-dt:~/code/dgos/build$ cat emb.S | |
.section .text.entry | |
entry: | |
jmp _start | |
.section .text | |
_start: | |
jmp _start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment