Skip to content

Instantly share code, notes, and snippets.

@7shi
7shi / openbsd-crunchgen.diff
Created Feb 12, 2010
OpenBSDでクロス用にcrunchgenをやっつけ修正
View openbsd-crunchgen.diff
--- usr.sbin/crunchgen/elf_hide.c.orig Fri Feb 12 04:53:11 2010
+++ usr.sbin/crunchgen/elf_hide.c Fri Feb 12 19:42:55 2010
@@ -416,13 +416,22 @@
prela = (Elf_RelA *) (pexe + pshdr->sh_offset);
num_reloc = pshdr->sh_size / sizeof(Elf_RelA);
for (j = 0; j < num_reloc; j++) {
+#ifdef HOSTLE_ELF64LE
+ uint32_t *psymnum = (uint32_t *)&prela[j].r_info;
+ symnum = *psymnum;
+#else
@7shi
7shi / openbsd-rdsetroot-nlist.diff
Created Feb 12, 2010
OpenBSDのrdsetrootを無理やり動かす
View openbsd-rdsetroot-nlist.diff
--- lib/libc/gen/nlist.c.orig Fri Feb 12 03:32:14 2010
+++ lib/libc/gen/nlist.c Fri Feb 12 20:49:07 2010
@@ -274,6 +274,9 @@
int
__elf_is_okay__(Elf_Ehdr *ehdr)
{
+#ifdef NOARCHCHECK
+ return IS_ELF(*ehdr);
+#else
int retval = 0;
@7shi
7shi / openbsd-gdium.txt
Created Feb 12, 2010
GdiumでOpenBSDを起動させようとして失敗
View openbsd-gdium.txt
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2010 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 4.7-beta (RAMDISK) #5: Fri Feb 12 20:48:34 JST 2010
root@openbsd-vm.my.domain:/usr/src/sys/arch/loongson/compile/RAMDISK
real mem = 536870912 (512MB)
avail mem = 516784128 (492MB)
mainbus0 at root
cpu0 at mainbus0: STC Loongson2F CPU 891 MHz, STC Loongson2F FPU
@7shi
7shi / patch-filter_texttops_c
Created Mar 1, 2010
GdiumでldがGOTエラーになるので小手先の修正
View patch-filter_texttops_c
--- filter/texttops.c.orig Tue Mar 2 05:10:03 2010
+++ filter/texttops.c Tue Mar 2 05:30:35 2010
@@ -33,16 +33,16 @@
/*
- * Globals...
+ * Locals...
*/
View gxemul-0.4.7.2-arc-cobalt-mcclock.diff
--- src/devices/dev_mc146818.c.orig
+++ src/devices/dev_mc146818.c
@@ -209,11 +209,13 @@
* emulation. However, for Linux, commenting out this line
* works better. (TODO: Find a way to make both work?)
*/
- d->reg[4 * MC_YEAR] += 80;
+ d->reg[4 * MC_YEAR] -= 20;
break;
+ case MC146818_ARC_JAZZ:
View hello.exe.xz.b64
begin-base64 644 hello.exe.xz
/Td6WFoAAATm1rRGAgAhARAAAACocI6G4Av/AYVdACaWjnAAF/fsBbvq9P+UAS9E73zm9QkZRAIp
/1PN1tEU/p5hnIIV9gl6rGu07VQQnibKcc/FRyvI6yJF/kH6s1mPcgQJgG86bF7FVAXcqCcRClyf
j1G5vP7zT6DtkxosDuxPmNiog1ffycSH/56DHTKfNYL3s/u3z6SglVhRnwfOiZzPxp8HlHsksHsu
sIarOm/R3T8oGiwWy0LU09vhJxf4rEhOnsDpHdMCaWI9LBhj9bQKmndNwDl2K39BE0z3lZ4PnoQJ
4txglbouNO+eE+Tv24jzoTSqTYErAuO55hYkLNIgG75CGAzAg5A6I7+CGc/nBtfE8WctsSwIcw7T
zRlxCp7EJJHZNqdmWcVO6mr7iLvPvMT7Z6N7xJ6iiJiD8K6eeBVCC9sL8IjlEqEmdrpEt8lUyTzv
Ec9EyHaRYf8tfqH8TJ7maEvMsB8rti1NzbhkW/dPRVvjNdBY0LUpZTDBdYs1YdovSwKpdAljfSgk
jpW3MAmt10UCJpyOdth8Ta5b6Q8gAAAAALbBU2LxVe2cAAGhA4AYAAC1KNmpscRn+wIAAAAABFla
@7shi
7shi / console.fs
Created Mar 25, 2010
F# Interactiveの改造
View console.fs
#light
namespace Microsoft.FSharp.Compiler.Interactive
open System
open System.IO
open System.Text
open System.Collections.Generic
type ReadLineConsole(complete: (string option * string -> seq<string>)) as this =
@7shi
7shi / gist:343277
Created Mar 25, 2010
mipsel-peのリンカがおかしい
View gist:343277
h-evc.exe: file format pei-mips
Disassembly of section .text:
00401000 <.text>:
401000: 27bdffe8 addiu $sp,$sp,-24
401004: afbf0010 sw $ra,16($sp)
401008: 3c020040 lui $v0,0x40
40100c: 24463020 addiu $a2,$v0,12320
@7shi
7shi / gist:343302
Created Mar 25, 2010
mipsel-peのテスト
View gist:343302
# cat hello.c
void start()
{
MessageBoxA(0, "Hello, NT4/MIPS!", "mipsel-pe-gcc", 0);
}
# mips-pe-gcc -G0 -EL -S hello.c
# cat hello.s
.file 1 "hello.c"
gcc2_compiled.:
__gnu_compiled_c:
View binutils-2.11.2-mips-pe.diff
--- bfd/peicode.h.orig 2010-03-26 12:55:32.000000000 +0900
+++ bfd/peicode.h 2010-03-26 12:55:55.000000000 +0900
@@ -977,7 +977,7 @@
{
pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S,
(struct symbol_cache_entry **) imp_sym, imp_index);
- pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text);
+ /*pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text);*/
pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16,
(struct symbol_cache_entry **) imp_sym, imp_index);
You can’t perform that action at this time.