1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
catch up to recent bridge also fixes following issues
for i386
http://www.openoffice.org/issues/show_bug.cgi?id=98781
http://www.openoffice.org/issues/show_bug.cgi?id=82690
http://www.freebsd.org/cgi/query-pr.cgi?pr=127946
We also need
#define USE_DOUBLE_MMAP for FreeBSD as well. The patch was included
in files/patches-i85126
--- bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx 2009-12-12 18:15:33.000000000 +0900
+++ bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx 2009-12-06 13:19:58.000000000 +0900
@@ -362,7 +362,7 @@
int const codeSnippetSize = 16;
unsigned char * codeSnippet(
- unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset,
+ unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 functionIndex, sal_Int32 vtableOffset,
typelib_TypeClass returnTypeClass)
{
if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass)) {
@@ -408,7 +408,7 @@
// jmp privateSnippetExecutor:
*p++ = 0xE9;
*reinterpret_cast< sal_Int32 * >(p)
- = ((unsigned char *) exec) - p - sizeof (sal_Int32);
+ = ((unsigned char *) exec) - p - sizeof (sal_Int32) - writetoexecdiff;
p += sizeof (sal_Int32);
OSL_ASSERT(p - code <= codeSnippetSize);
return code + codeSnippetSize;
@@ -419,8 +419,7 @@
struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
bridges::cpp_uno::shared::VtableFactory::Slot *
-bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
-{
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) {
return static_cast< Slot * >(block) + 2;
}
@@ -441,7 +440,7 @@
}
unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
- Slot ** slots, unsigned char * code,
+ Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
sal_Int32 functionCount, sal_Int32 vtableOffset)
{
@@ -454,9 +453,9 @@
switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
// Getter:
- (s++)->fn = code;
+ (s++)->fn = code + writetoexecdiff;
code = codeSnippet(
- code, functionOffset++, vtableOffset,
+ code, writetoexecdiff, functionOffset++, vtableOffset,
reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
member)->pAttributeTypeRef->eTypeClass);
// Setter:
@@ -464,17 +463,17 @@
typelib_InterfaceAttributeTypeDescription * >(
member)->bReadOnly)
{
- (s++)->fn = code;
+ (s++)->fn = code + writetoexecdiff;
code = codeSnippet(
- code, functionOffset++, vtableOffset,
+ code, writetoexecdiff, functionOffset++, vtableOffset,
typelib_TypeClass_VOID);
}
break;
case typelib_TypeClass_INTERFACE_METHOD:
- (s++)->fn = code;
+ (s++)->fn = code + writetoexecdiff;
code = codeSnippet(
- code, functionOffset++, vtableOffset,
+ code, writetoexecdiff, functionOffset++, vtableOffset,
reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
member)->pReturnTypeRef->eTypeClass);
break;
--- bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx 2009-12-12 18:15:33.000000000 +0900
+++ bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx 2009-12-06 13:19:58.000000000 +0900
@@ -32,6 +32,7 @@
#include "precompiled_bridges.hxx"
#include <stdio.h>
+#include <string.h>
#include <dlfcn.h>
#include <cxxabi.h>
#include <hash_map>
@@ -121,7 +122,7 @@
};
//__________________________________________________________________________________________________
RTTI::RTTI() SAL_THROW( () )
-#if __FreeBSD_version < 602103
+#if __FreeBSD_version < 702104 /* #i22253# */
: m_hApp( dlopen( 0, RTLD_NOW | RTLD_GLOBAL ) )
#else
: m_hApp( dlopen( 0, RTLD_LAZY ) )
@@ -160,7 +161,7 @@
buf.append( 'E' );
OString symName( buf.makeStringAndClear() );
-#if __FreeBSD_version < 602103 /* #i22253# */
+#if __FreeBSD_version < 702104 /* #i22253# */
rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
#else
rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
|