Commit Graph

132 Commits

Author SHA1 Message Date
Axel Dörfler
3728e62e88 Unlike the ELF specs, BeOS ignores the path of shared objects specified by the DT_NEEDED
element. We now soften the rule that the absolute path should be used, and give libraries
another chance and search them in the standard search paths. This fixes bug #601 and lets
Becasso run on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17669 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-31 15:59:42 +00:00
Axel Dörfler
d7b5138a70 Some more GCC 4.1.0 fixes, more to come (tomorrow).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-17 21:40:29 +00:00
Axel Dörfler
9c243392a4 Even short scripts are B_NOT_AN_EXECUTABLE, and not B_BAD_VALUE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-16 01:01:17 +00:00
Axel Dörfler
9a6bbd514e Once libroot's getenv() is available, that one will be used instead of the one built in.
This makes the runtime_loader able to adopt path changes properly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-08 23:50:09 +00:00
Jérôme Duval
ce91cbc42d now checks if a search entry is a directory and returns B_IS_A_DIRECTORY in case it's the sole entry for this name (btw getenv(PATH) doesn't return the current PATH)
fixes bug #569


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-08 20:07:01 +00:00
Axel Dörfler
0f0234a5d0 We no longer return B_OK in test_executable() for executables that don't
define an entry point (like shared libraries).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17022 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-06 06:16:20 +00:00
Axel Dörfler
2ed4099289 Renamed the linker script to runtime_loader.ld to match the rest.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-30 18:10:59 +00:00
Axel Dörfler
af3e5cd947 Renamed our runtime loader from rld.so to runtime_loader, and moved it into beos/system/.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-30 18:08:51 +00:00
Axel Dörfler
76cd9b1961 Renamed runtime loader source files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-30 16:29:53 +00:00
Axel Dörfler
87a9cb2d70 * No longer tries to start an application that doesn't export an entry point != NULL.
This fixes bug #360.
* Also removed no longer necessary undefining of _KERNEL_MODE, as we're now built
  correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16930 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-30 14:17:14 +00:00
Axel Dörfler
93c49610b5 Improved error output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-19 14:34:21 +00:00
Axel Dörfler
aa9383c1f2 And the final build fix: the boot loader was using libroot's strlen.o object
file (which does no longer exist) - it now uses the one from the kernel as a
quick fix.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-17 01:18:20 +00:00
Ingo Weinhold
bae7848e66 We were trashing non-volatile register ebx in the arch_call_{init,term}()
functions. Weird things could happen due to that. E.g. application crashes when 
unloading add-ons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-17 02:21:17 +00:00
Ingo Weinhold
1005ea4b5d Fixed PPC build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15857 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-07 19:35:18 +00:00
Stephan Aßmus
71d2531d52 terminate_program() is now actually called - forgot to commit this before...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-06 11:09:44 +00:00
Stephan Aßmus
34a9556215 Made our glue code compatible to BeOS again. IOW executables compiled for Haiku will
now run under BeOS as well (as long as they don't use any functions that are not
available under R5).
The solution is a bit messy, but we have to live with it :-)
The runtime loader now patches the __gRuntimeLoader symbol in libroot.so to point
to its exported structure instead of passing it to the init functions as an
argument.
(Hax0red by axeld and bonefish on stippi's assimilated machine -- resistence is futile)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15848 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-06 03:48:11 +00:00
Axel Dörfler
a31b66b768 Added tracing for calling the init routines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-28 14:47:51 +00:00
Ingo Weinhold
353d20c0c5 * libroot and the runtime loader are no longer built with kernel rules.
* New rule Ld, analogously to KernelLd.
* Added StaticLibrary parameter for supplying additional objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15191 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-27 13:31:50 +00:00
Ingo Weinhold
38f6264454 Reorganized building of kernel, boot loader, and libroot.
Each component is built in the respective subdirectory now
and no longer in src/system/Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-27 00:27:19 +00:00
Ingo Weinhold
df23b0271e Corrected the sizes of the text and data segments reported to the
kernel. They are now the sizes of the allocated areas, which might be a
bit more than the actually used size, but at least they are not
potentially less, as they were before. This could have unexpected
effects like the Tracker not finding its resources... 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 00:27:42 +00:00
Ingo Weinhold
9cc1e772dc More debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 17:22:55 +00:00
Ingo Weinhold
ad512dbeac Print error code when relocation failed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 15:21:54 +00:00
Ingo Weinhold
338b8dc301 Merged changes from branch build_system_redesign at revision 14573.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-29 16:27:43 +00:00
Marcus Overhagen
794df3bf25 This removes the inline assembly code for find_thread
from OS.h, sorry for triggering a complete rebuild.
To avoid doing a syscall for find_thread(0), the assembly
version is now in libroot. For BeOS R5 compatibility, 
_kfind_thread_ is retained. This will fix some compile 
problems, and provides a cleaner OS.h for future Haiku
versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 23:57:11 +00:00
Axel Dörfler
90f1dccb72 Our ELF loader now gets something like error handling - it may still have some
(memory) holes, but failing to load an add-on should no longer exit your
application. Reported by Korli.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-12 20:52:46 +00:00
Ingo Weinhold
7f53c2cc96 We now make sure, that images always have absolute paths, otherwise
their path could be invalid in other contexts (e.g. the debug server might
be unabled to find them). This seems to be what BeOS does, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13796 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-21 23:51:02 +00:00
Axel Dörfler
09105be0f8 Now uses the TO_PAGE_SIZE() macro already defined to round the debug area to a page size multiple.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-17 12:54:41 +00:00
Ingo Weinhold
28e0d4cd19 The runtime loader now creates a debug area through which other teams can
access a team's internal loader data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 21:07:17 +00:00
Axel Dörfler
43ed6aa0db The "shebang" handler is supposed to parse arguments, too - we now do that.
Also, when the line is too long, E2BIG is returned.
Thanks to Korli who pointed me to this: http://homepages.cwi.nl/~aeb/std/shebang/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 12:39:06 +00:00
Axel Dörfler
be22452f3b Apparently, both load_image() and exec*() support running scripts. We do that
now as well.
Also, both functions will now test if the executable exists and is valid; that
way, load_image()/exec*() can catch many errors without having to create a new
team (or erase the current one - an exec*("my invalid app") might now return
with an error).
The runtime linker now exports a function to test executables that is aware
of the search paths, and will also check user permissions upfront.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 11:23:29 +00:00
Axel Dörfler
718b5114e0 This should fix the build after all the kernel/system renaming.
If anything is still broken (and was not before :)), please shout.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 13:59:17 +00:00
Axel Dörfler
5af32e7526 Renamed src/kernel to src/system.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 13:06:35 +00:00