summaryrefslogtreecommitdiff
path: root/rts/Linker.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add array copy/clone primopsDaniel Peebles2011-05-191-0/+6
|
* Unicode fixes, taking into account PEP383 supportMax Bolingbroke2011-05-141-0/+2
|
* Make the GHCi linker handle partially stripped object files (#5004)Duncan Coutts2011-05-131-74/+89
| | | | | | | | | | | | | | | | | | | | | | When you use 'strip --strip-unneeded' on a ELF format .o or .a file, if the object file has no global/exported symbols then 'strip' ends up removing the symbol table entirely. Previously the GHCi linker assumed there would always be exactly one symbol table and exactly one string table. In fact, in ELF object files there is no such limitation, instead each section points to the other sections it needs, in particular relocation sections have a link to the symbol table section they use and symbol table sections have a link to the corresponding string table. So instead of assuming there will always be a global symbol and string table, all we have to do is validate and follow these links. Then, when we encounter an empty object file that has no symbols then we handle it correctly, because since it's empty we never process any relocations and so never have to follow any links to non-existant symbol tables. Also, in the case where an object is fully stripped, we can now detect this more reliably and emit a more helpful error message, e.g: libHSghc-7.1.20110509.a(DsMeta.o): relocation section #2 has no symbol table This object file has probably been fully striped. Such files cannot be linked.
* For very short linker scripts dlopen may return 'file too short' insteadCJ van den Berg2011-04-201-1/+1
| | | | of 'invalid ELF header'.
* This is required to successfully load terminfo into GHCi in currentCJ van den Berg2011-04-201-3/+3
| | | | | versions of Fedora. The INPUT command is use by libncursesw.so in Fedora.
* Fix compiling on linux-powerpc.Erik de Castro Lopo2011-04-121-7/+11
|
* add casMutVar#Simon Marlow2011-04-111-0/+1
|
* Support fat archives on OS XIan Lynagh2011-04-091-7/+94
| | | | Based on the darcs patch from Greg Wright in #4828.
* rts/Linker.c tidyups and debug belchesIan Lynagh2011-04-081-80/+117
| | | | Part of the patch from #5062, from Greg Wright.
* Take strlen of archive filenames.Ian Lynagh2011-04-031-46/+119
| | | | | | | | | On OS X at least, the filename size is the size of the filename field. The actual filename may be shorter. Also a number of code style improvements and debug prints. This is part of the patch from #5062, from Greg Wright.
* add atexit (#4456)Simon Marlow2011-03-291-0/+1
|
* Fix #4867 (updated; corrects address calculation)gwright@antiope.com2011-02-141-1/+6
| | | | | | | | | | | | | This is a corrected fix for ticket #4867, "ghci displays negative floats incorrectly". The previous patch sometimes gave incorrect offset to values in the __const section of the __TEXT segment. The new patch arranges a zero fixup for non-external, not-global offset table signed relocations. This is apparently what is required, though documentation on this point is scarce. With this change Doubles are negated properly, because the sign bit mask is loaded from the correct offset. This was tested both on HEAD and the 7.0 branch.
* Fix #4867, ghci displays negative floats incorrectlygwright@antiope.com2011-02-091-3/+1
| | | | | | | | | | | | This patch fixes the erroneous relocations that caused the bug in ticket #4867. External addresses and global offset table entries were relocated correctly, but all other relocations were incorrectly calculated. This caused, for example, bad references to constants stored in the __const section of the __TEXT segment. This bug only affected OS X on 64-bit platforms.
* Fix validate on OS X 64Ian Lynagh2011-01-241-2/+3
|
* Include kfreebsdgnu in the list of Target Platforms.Marco Silva2011-01-181-5/+6
|
* Count allocations more accuratelySimon Marlow2010-12-211-1/+1
| | | | | | | | | | | The allocation stats (+RTS -s etc.) used to count the slop at the end of each nursery block (except the last) as allocated space, now we count the allocated words accurately. This should make allocation figures more predictable, too. This has the side effect of reducing the apparent allocations by a small amount (~1%), so remember to take this into account when looking at nofib results.
* Whitespace-only in rts/Linker.cIan Lynagh2010-12-171-918/+918
|
* Add some casts to fix warnings; patch from Greg WrightIan Lynagh2010-12-171-4/+4
|
* Fix Windows build: move rtsTimerSignal to the POSIX-only sectionSimon Marlow2010-12-101-2/+2
|
* Export the value of the signal used by scheduler (#4504)Dmitry Astapov2010-12-081-0/+1
|
* FIX #1845 (unconditional relative branch out of range)pho@cielonegro.org2010-11-301-1/+12
| | | | | | | Don't use mmap on powerpc-apple-darwin as mmap doesn't support reallocating but we need to allocate jump islands just after each object images. Otherwise relative branches to jump islands can fail due to 24-bits displacement overflow.
* rts/Linker.c (loadArchive):pho@cielonegro.org2010-11-301-2/+10
| | | | This routine should be aware of Mach-O misalignment of malloc'ed memory regions.
* rts/Linker.c (machoGetMisalignment):pho@cielonegro.org2010-11-301-9/+12
| | | | Use fseek(3) instead of rewind(3) to move the file position indicator back to the initial position. Otherwise we can't use this function in loadArchive().
* rts/Linker.c (ocFlushInstructionCache):pho@cielonegro.org2010-11-301-5/+12
| | | | I found this function causes a segfault when ocAllocateSymbolExtras() has allocated a separate memory region for jump islands.
* Add GNU-variant support to the .a parser, and other improvements/tidyupsIan Lynagh2010-11-271-44/+149
|
* Re-indent onlyIan Lynagh2010-11-271-133/+137
|
* Improve linker debugging for archive filesIan Lynagh2010-11-271-1/+5
|
* Always enable the archive-loading codeIan Lynagh2010-11-271-11/+9
| | | | If the GHCi .o lib doesn't exist, load the .a instead
* Uncomment and fix an OS X linker debug printIan Lynagh2010-10-291-1/+1
|
* Comment out bogus debug line that broke build on OSXbenl@ouroborus.net2010-10-291-1/+1
|
* Replace some exit(n) calls with stg_exit(n); fixes trac #4445Ian Lynagh2010-10-281-1/+1
| | | | Also changed exitcode of -1 to 1 in hpc.
* Fix for #4318 (Linker failure on OS X 10.6)gwright@antiope.com2010-10-261-27/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two bugs in the Mach-O linker and adds debugging statements to the same. The bugs: 1. The test for symbol->n_value == 0 is removed and replaced by a test of the flag field. Checking the n_value field was just wrong; the value of a symbol should only be examined when allocating space for a common block, in which case the n_value field gives the size of the block. This bug led to an infrequently occuring linker crash. I believe the behavior of the linker now agrees with the intent of the sketchy Apple documentation. 2. Jump islands were being filled with garbage instead of the the location of the referenced symbol. This caused relocations of type X86_64_RELOC_GOT and X86_64_RELOC_GOT_LOAD to eventually lead to crashes. The fix is simply to look up the symbol. Enough debug statements have been added to follow the operation of the Mach-O linker while it loads modules. They are not yet as informative and well organized as for ELF. Improving the debug statements will require some reorganization of the code -- the Mach-O linker seems basically sound, but is crying out for some refactoring and commenting.
* New member "archiveMemberName" for struct _ObjectCodepho@cielonegro.org2010-09-271-21/+70
| | | | | struct _ObjectCode should be able to retain the name of archive members. Though currently the only use of those names are for debugging outputs.
* Fix the Windows __chkstk build error (missing Linker symbol)Simon Marlow2010-09-241-10/+4
|
* Fix indexing error in archive loaderIan Lynagh2010-09-211-1/+1
|
* Add some -Dl belchesIan Lynagh2010-09-211-0/+8
|
* Add casts to fix warningsIan Lynagh2010-09-211-2/+2
|
* Add support for BSD-variant large filenames in .a archivesIan Lynagh2010-09-211-11/+40
|
* Implement archive loading for ghciIan Lynagh2010-09-201-36/+199
|
* COFF: cope with new debug sections in gcc 4.x (fixes ghciprog004)Simon Marlow2010-09-141-18/+69
| | | | | Also updated the object file parser to properly handle the overflow case for section names longer than 8 chars.
* make stg_arg_bitmaps public, and available via the GHCi linker (#3672)Simon Marlow2010-09-131-0/+1
|
* FIX BUILD: add rts_isProfiled to the symbol tableSimon Marlow2010-08-261-0/+1
|
* Integrate new I/O manager, with signal supportJohan Tibell2010-07-241-8/+8
|
* On amd64/OSX we don't need to be given memory in the first 31bitsIan Lynagh2010-08-051-4/+24
| | | | as PIC is always on
* Add some error belchs to the linker, when we find bad magic numbersIan Lynagh2010-07-231-4/+16
|
* Add some more linker debugging printsIan Lynagh2010-07-231-5/+21
|
* add numSparks# primop (#4167)Simon Marlow2010-07-201-0/+1
|
* Change some TARGET tests to HOST tests in the RTSIan Lynagh2010-07-131-5/+5
| | | | Which was being used seemed to be random
* New asynchronous exception control API (ghc parts)Simon Marlow2010-07-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | As discussed on the libraries/haskell-cafe mailing lists http://www.haskell.org/pipermail/libraries/2010-April/013420.html This is a replacement for block/unblock in the asychronous exceptions API to fix a problem whereby a function could unblock asynchronous exceptions even if called within a blocked context. The new terminology is "mask" rather than "block" (to avoid confusion due to overloaded meanings of the latter). In GHC, we changed the names of some primops: blockAsyncExceptions# -> maskAsyncExceptions# unblockAsyncExceptions# -> unmaskAsyncExceptions# asyncExceptionsBlocked# -> getMaskingState# and added one new primop: maskUninterruptible# See the accompanying patch to libraries/base for the API changes.
* Add PPC_RELOC_LOCAL_SECTDIFF support; patch from PHO in #3654Ian Lynagh2010-06-011-1/+2
|