History log of /haiku/headers/private/kernel/elf.h
Revision Date Author Comments
# a553e95d 04-May-2018 Jérôme Duval <jerome.duval@gmail.com>

kernel: support elf32 on x86_64.

* define ELF32_COMPAT to enable ELF32 macros.
* add a flag ELF_LOAD_USER_IMAGE_TEST_EXECUTABLE to only check the format.
It will be used by load_image_internal() to check which mode to use when
loading an image.
* in arch_elf_relocate_rel(), switch to elf_addr instead of addr_t, which
would be the wrong size for elf32 on x86_64.
* the ELF compat loader reuses the relevant parts of elf.cpp and arch_elf.cpp,
excluding for instance load_kernel_add_on() or dump functions.

Change-Id: Ifa47334e5adefd45405a823a3accbd12eee5b116


# 90f57186 22-May-2016 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel: Add elf_read_kernel_image_symbols()

Refactor new function out of _user_read_kernel_image_symbols(). Can be
used to get a kernel image's symbols from within the kernel as well.


# 75c31ae2 26-Oct-2015 Simon South <ssouth@simonsouth.com>

system: Build using public elf.h header

Reduce duplication of code by

* Removing from elf_common.h definitions available in os/kernel/elf.h
* Deleting elf32.h and elf64.h
* Renaming elf_common.h to elf_private.h
* Updating source to build using public and private ELF header files
together

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# 459e651f 11-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

syscalls: Remove lookup_symbol syscall again.

This partially reverts b959d46dbd2f9087ae860dbced40440c28596a6e.


# b959d46d 10-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

syscalls: Add get_stack_trace and lookup_symbol syscalls.

The get_stack_trace syscall generates a stack trace using the kernel
debugging facilities and copies the resulting return address array to
the preallocated buffer from userland. It is only possible to get a
stack trace of the current thread.

The lookup_symbol syscall can be used to look up the symbol and image
name corresponding to an address. It can be used to resolve symbols
from a stack trace generated by the get_stack_trace syscall. Only
symbols of the current team can be looked up. Note that this uses
the symbol lookup of the kernel debugger which does not support lookup
of all symbols (static functions are missing for example).

This is meant to be used in situations where more elaborate stack trace
generation, like done in the userland debugging helpers, is not possible
due to constraints.


# 8a190335 07-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Implemented user debugging support for x86_64.

Reused x86 arch_user_debugger.cpp, with a few minor changes to make
the code work for both 32 and 64 bit. Something isn't quite working
right, if a breakpoint is hit the kernel will hang. Other than that
everything appears to work correctly.


# 24df6592 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0aad96f 22-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Allow to use symbols as variables (prefixed with '@'). Now only tab completion
for variable names is missing B-}


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33723 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b36c8ba2 08-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added elf_get_kernel_image() returning the image for the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30036 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fec47a57 24-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added functions elf_create_memory_image() and
elf_add_memory_image_symbol(). The former creates and registers a new
image that has not been loaded from a file. The latter adds a symbol to
its symbol table. This is mainly a debug feature, allowing to name code
or data in memory regions that aren't associated with loaded ELF
objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27721 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8839d592 22-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added syscall _kern_read_kernel_image_symbols() for reading a kernel
image's symbol and string tables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd1c278d 03-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added elf_get_image_info_for_address() to get an image info for a kernel
image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27300 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2477bce5 19-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for userland symbol lookup in "sc" and "call". Having
used it for an hour or so, I really wonder how we could live without it.
:-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23640 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5793da1e 22-Aug-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed elf_lookup_symbol_address() to elf_debug_lookup_symbol_address() and
removed the locking it did, as that doesn't work anymore in the kernel debugger.
The function was not thought to be used outside the debugger, anyway.
Improved usage message from debugger command "ls".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b043d9 17-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Removed execute property that was set accidently (since CVS days).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dca26362 20-Jan-2005 Axel Dörfler <axeld@pinc-software.de>

Improved headers, updated license, made C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10909 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6fccd3b7 31-May-2004 Axel Dörfler <axeld@pinc-software.de>

Changed elf_lookup_symbol_address() prototype - due to the way it now returns
its information, it's no longer safe to call this function outside the debugger.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d81a053b 11-May-2004 Axel Dörfler <axeld@pinc-software.de>

Bye, bye elf_lookup_symbol(), hello get_image_symbol().
Also renamed elf_load_kspace() to load_kernel_add_on(), and friends.
The new unload_kernel_add_on() now has an image_id as parameter, no longer
a path (like the former elf_unload_kspace()).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7529 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eaa91326 27-Apr-2004 Axel Dörfler <axeld@pinc-software.de>

Changed some function return codes to return a status_t where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50ba16fc 17-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Made C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5075 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9f956562 13-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Missed that one, obviously.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2451 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ca8da7a 13-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Backported the new stack crawl command ("sc", not "bt" like in NewOS) from
NewOS. Untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@750 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3cfbecf1 02-Aug-2002 lillo <lillo@nowhere.fake>

First round of big changes: the term team has replaced proc all over the kernel, the few kern_* syscalls have been renamed to sys_* for consistency, and other small changes. The ps app is temporarily disabled until get_next_team_info is implemented.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@557 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 459e651fd518aaecda9ff6079ea0385456e0be5b 11-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

syscalls: Remove lookup_symbol syscall again.

This partially reverts b959d46dbd2f9087ae860dbced40440c28596a6e.


# b959d46dbd2f9087ae860dbced40440c28596a6e 10-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

syscalls: Add get_stack_trace and lookup_symbol syscalls.

The get_stack_trace syscall generates a stack trace using the kernel
debugging facilities and copies the resulting return address array to
the preallocated buffer from userland. It is only possible to get a
stack trace of the current thread.

The lookup_symbol syscall can be used to look up the symbol and image
name corresponding to an address. It can be used to resolve symbols
from a stack trace generated by the get_stack_trace syscall. Only
symbols of the current team can be looked up. Note that this uses
the symbol lookup of the kernel debugger which does not support lookup
of all symbols (static functions are missing for example).

This is meant to be used in situations where more elaborate stack trace
generation, like done in the userland debugging helpers, is not possible
due to constraints.


# 8a1903353eedd95266c7241aada3a314c5d35a55 07-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Implemented user debugging support for x86_64.

Reused x86 arch_user_debugger.cpp, with a few minor changes to make
the code work for both 32 and 64 bit. Something isn't quite working
right, if a breakpoint is hit the kernel will hang. Other than that
everything appears to work correctly.


# 24df65921befcd0ad0c5c7866118f922da61cb96 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0aad96f945323bdabadd6a91a2cddd5985bbe5f 22-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Allow to use symbols as variables (prefixed with '@'). Now only tab completion
for variable names is missing B-}


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33723 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b36c8ba26ad642c712987f68e7b8ca9bccaa19bb 08-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added elf_get_kernel_image() returning the image for the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30036 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fec47a570239d9505c56b680fb3c2564c9988c14 24-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added functions elf_create_memory_image() and
elf_add_memory_image_symbol(). The former creates and registers a new
image that has not been loaded from a file. The latter adds a symbol to
its symbol table. This is mainly a debug feature, allowing to name code
or data in memory regions that aren't associated with loaded ELF
objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27721 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8839d592bce4b8ffebdb440ed50085fbf397975b 22-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added syscall _kern_read_kernel_image_symbols() for reading a kernel
image's symbol and string tables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd1c278d4b64ef9c143903384a85d4c5aabc2770 03-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added elf_get_image_info_for_address() to get an image info for a kernel
image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27300 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2477bce5046dba76204a8c8b75ea773be4ae9748 19-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for userland symbol lookup in "sc" and "call". Having
used it for an hour or so, I really wonder how we could live without it.
:-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23640 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5793da1edcbf2e1fe0fefbdd45f7d6cefc6524c9 22-Aug-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed elf_lookup_symbol_address() to elf_debug_lookup_symbol_address() and
removed the locking it did, as that doesn't work anymore in the kernel debugger.
The function was not thought to be used outside the debugger, anyway.
Improved usage message from debugger command "ls".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b043d98d35652a6892fc430537a02f5f9d9f76 17-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Removed execute property that was set accidently (since CVS days).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dca263620a1237a1b79b19805d9ea64dabdede12 20-Jan-2005 Axel Dörfler <axeld@pinc-software.de>

Improved headers, updated license, made C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10909 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6fccd3b78824414ba256a77fd083d5ed0ac28248 31-May-2004 Axel Dörfler <axeld@pinc-software.de>

Changed elf_lookup_symbol_address() prototype - due to the way it now returns
its information, it's no longer safe to call this function outside the debugger.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d81a053b902bfb7292384c4da88a8e87e7accaa2 11-May-2004 Axel Dörfler <axeld@pinc-software.de>

Bye, bye elf_lookup_symbol(), hello get_image_symbol().
Also renamed elf_load_kspace() to load_kernel_add_on(), and friends.
The new unload_kernel_add_on() now has an image_id as parameter, no longer
a path (like the former elf_unload_kspace()).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7529 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eaa9132647e70f179aa8489d23f039fe72c0d016 27-Apr-2004 Axel Dörfler <axeld@pinc-software.de>

Changed some function return codes to return a status_t where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50ba16fccf29cbdb05ce68d65a2440e796e430ac 17-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Made C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5075 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9f956562e531023a72dcaae90a8525c02aa26f7b 13-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Missed that one, obviously.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2451 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ca8da7a4b46342b22fa985c7813b558f831484f 13-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Backported the new stack crawl command ("sc", not "bt" like in NewOS) from
NewOS. Untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@750 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3cfbecf1a6bfb811556eed42284ad75f9568a9fe 02-Aug-2002 lillo <lillo@nowhere.fake>

First round of big changes: the term team has replaced proc all over the kernel, the few kern_* syscalls have been renamed to sys_* for consistency, and other small changes. The ps app is temporarily disabled until get_next_team_info is implemented.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@557 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96