hostinfo & ldscript

This commit is contained in:
joonicks
2018-03-13 02:39:29 +01:00
parent 3a5bb7c761
commit 149ddd196c
11 changed files with 66 additions and 118 deletions

View File

@@ -9,13 +9,22 @@
#define S(x) x,sizeof(x)
__page(".text.e")
#if 0
*(.text.e) /* RARE */
*(.text.d) /* INIT */ main
*(.text.b) /* CFG1 */ func2
*(.text.c) /* CMD1 */ func1
*(.text.a) /* CORE */
*(.text.f) /* DBUG */
#endif
__page(".text.c")
int function1(int a)
{
return a + 1;
}
__page(".text.c")
__page(".text.b")
int function2(int a)
{
return a + 2;
@@ -24,7 +33,7 @@ int function2(int a)
__page(".text.d")
int main(int argc, char **argv)
{
if (((void*)main < (void*)function1) && ((void*)function1 < (void*)function2))
if (((void*)main < (void*)function2) && ((void*)function2 < (void*)function1))
write(1,S("yes\n"));
else
write(1,S("no\n"));