Commit Graph

231 Commits

Author SHA1 Message Date
Lubos Dolezel
a4ba1d1de9 BSD Libc based err.h impl 2012-08-03 16:03:57 +02:00
Lubos Dolezel
2864895438 err(3) function fixes 2012-08-03 13:25:26 +02:00
Lubos Dolezel
f224c73e3b Add errc, wanrc etc. function calls for libc 2012-08-03 12:39:05 +02:00
Lubos Dolezel
9f0c830ce6 Errno related functionality 2012-08-03 10:25:40 +02:00
Lubos Dolezel
c04edbfc15 Semaphores implementation 2012-08-02 14:50:38 +02:00
Lubos Dolezel
0c60b58b89 OSAtomicEnqueue operation implementation 2012-08-02 14:17:23 +02:00
Lubos Dolezel
de6469a903 Initial OSAtomic implementation 2012-08-02 13:57:22 +02:00
Lubos Dolezel
54f1420179 Import of several XNU headers, Mach kernel basic VM implementation 2012-08-01 23:29:18 +02:00
Shinichiro Hamaji
d58a984814 Handle compat_mode, used from uname(1)
This change is suggested by Yoshi. Thanks!
2012-07-02 23:42:22 +09:00
Shinichiro Hamaji
75d921fc45 Translate en_US.* into C
It seems this is necessary to run clang for linux without locale info.
2012-06-19 14:53:56 +09:00
Shinichiro Hamaji
a0ace63e17 Handle newlocale 2012-06-19 13:26:06 +09:00
Shinichiro Hamaji
97cb8c2447 Add two functions recent clang uses
- It seems seekg is used only by nVidia's backend
- This arc4random might be not secure, but LLVM does use rand() as
  the fallback of arc4random so this might be OK for LLVM's purpose.
2012-06-19 10:40:53 +09:00
Shinichiro Hamaji
fca4318d30 Define some *_l functions, as new clang uses this
Currently, we just call the version which uses global locale
2012-04-25 08:26:19 +09:00
Shinichiro Hamaji
49c5cccf29 Handle fflush(NULL) properly
https://github.com/shinh/maloader/issues/6
2012-04-02 16:47:00 +09:00
Shinichiro Hamaji
01472d772c Don't try mmapping empty segments
It seems atos in xcode 4 has an empty segment named __RESTRICT.
May need further investigation.
2011-12-28 19:12:19 +09:00
Shinichiro Hamaji
d0a83b973a Version 0.4 2011-12-13 12:26:22 +09:00
Shinichiro Hamaji
299d407714 Handle classic (<10.5) stat 2011-12-12 19:59:41 +09:00
Shinichiro Hamaji
630a39e2c5 Fix opendir/readdir/closedir
For symbols with $INODE64, we should return the dirent with the new layout.
2011-12-12 18:11:27 +09:00
Shinichiro Hamaji
578be2bb37 Fixes for classic (<10.5) binaries
- Read LC_DYLD_INFO
- Handle exports before binds
- Check export table even for weak binds
2011-12-12 16:33:35 +09:00
Shinichiro Hamaji
8734f13fa1 Use values in classic weak binds 2011-12-08 03:25:22 +09:00
Shinichiro Hamaji
f61b3e178d Use nlist for classic binds
Also add a log output
2011-12-08 02:05:30 +09:00
Shinichiro Hamaji
b5e9592e7a Add a test for C++ class 2011-12-08 02:02:58 +09:00
Shinichiro Hamaji
697b63eb58 Add make check-all, which runs test with 10.5 ABI 2011-12-08 01:57:10 +09:00
Shinichiro Hamaji
9ffb01dafc Align vmsize as well as filesize for mmap 2011-11-20 23:02:12 +09:00
Shinichiro Hamaji
8e6140a673 Add naive memset_pattern(4|8|16)
This is necessary for clang in xcode 4.1
They might be slow, but should be OK. clang doesn't use them heavily.
2011-11-14 00:38:53 +09:00
Shinichiro Hamaji
e7546446a4 Now ld in xcode4 should work 2011-11-13 18:10:55 +09:00
Shinichiro Hamaji
545c157d2b Fix the handling for weak binds
Obviously, seen_weak_bind_iter may be invalidated while relocation...
2011-11-13 18:07:50 +09:00
Shinichiro Hamaji
45906e0f9d Handle @executable_path for dlopen 2011-11-13 18:03:10 +09:00
Shinichiro Hamaji
dc64505732 Map __LINKEDIT
Without this, ld in xcode 4 crashes due to

http://www.opensource.apple.com/source/Csu/Csu-79/lazy_dylib_loader.c

Note that we are not using LINKEDIT long time from

12df66e372

I cannot remember why I made this change...
2011-11-13 09:46:32 +09:00
Shinichiro Hamaji
892f6be081 Can unpack xcode-4.1 for snow leopard 2011-11-12 10:35:21 +09:00
Shinichiro Hamaji
fd306d2f28 Use ld-mac explicitly in runtests.sh 2011-11-12 09:54:39 +09:00
Shinichiro Hamaji
9282fbffee Merge pull request #5 from GunioRobot/clean
Hi! We cleaned up your code for you!
2011-10-21 22:49:13 -07:00
Gun.io Whitespace Robot
891c3c5bb6 Remove whitespace [Gun.io WhitespaceBot] 2011-10-21 06:55:37 -04:00
Shinichiro Hamaji
0b2c52dbb1 Use return values of fwrite 2011-10-11 11:09:08 +09:00
Shinichiro Hamaji
19f2a03196 Get rid of gcc-4.6 warnings 2011-10-11 10:58:10 +09:00
Shinichiro Hamaji
f95140af99 Fix a few style inconsistencies 2011-07-03 11:56:00 +09:00
Shinichiro Hamaji
875434309e Remove unnecessary TODOs 2011-07-03 11:55:49 +09:00
Shinichiro Hamaji
011b2973c6 Merge pull request #1 from OznOg/master
Some cleanup, strmode, and vm_msync
2011-07-02 19:52:35 -07:00
OznOg
939035d09d Add vm_msync function in libmac, but the implementation remains void. This allows ar to run an to work correctly (as far as I saw) but would need some real investigation. 2011-07-01 19:19:54 +02:00
OznOg
4bb503bb62 Added function strmode to libmac. This file was taken from a BSD project, I just removed useless preprocessor stuff at the very begining. 2011-07-01 19:04:49 +02:00
Shinichiro Hamaji
2e4d5b3226 Add a short description and license to ld-mac.sh 2011-06-16 23:53:12 +09:00
Shinichiro Hamaji
d6f41e36e1 Update README to explain how to run both 32bit and 64bit Mach-O binaries 2011-06-16 23:50:19 +09:00
Shinichiro Hamaji
4e07ab7de4 hello.c outputs different texts based on __x86_64__ predefined macro 2011-06-16 23:49:11 +09:00
Shinichiro Hamaji
cb4375b889 Add make both which creates both ld-mac and ld-mac32 2011-06-16 23:44:26 +09:00
Shinichiro Hamaji
2344923594 Now binfmt_misc.sh handles 32bit Mach-O as well 2011-06-16 23:40:24 +09:00
Shinichiro Hamaji
46543699be Add a shell script to switch ld-mac and ld-mac32 2011-06-16 23:40:09 +09:00
Shinichiro Hamaji
ea93cac923 Load libmac<BITS>.so when ld-mac cannot read libmac.so 2011-06-16 23:29:01 +09:00
Shinichiro Hamaji
fb1502b28a Update TODOs in README 2011-06-16 23:04:36 +09:00
Shinichiro Hamaji
88eea71abe Show the filename when the given file isn't mach-o 2011-06-15 23:16:26 +09:00
Shinichiro Hamaji
53c25351d7 Version 0.3 2011-06-14 20:37:48 +09:00