rpms/openoffice.org/devel workspace.sb113.patch, NONE, 1.1 openoffice.org.spec, 1.1993, 1.1994 openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch, 1.3, NONE

Caolan McNamara caolanm at fedoraproject.org
Wed Aug 26 11:11:18 UTC 2009


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11068

Modified Files:
	openoffice.org.spec 
Added Files:
	workspace.sb113.patch 
Removed Files:
	openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch 
Log Message:
rename to finally accepted upstream workspace

workspace.sb113.patch:
 signal.c |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

--- NEW FILE workspace.sb113.patch ---
Index: osl/unx/signal.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/signal.c,v
retrieving revision 1.32.14.1
diff -u -r1.32.14.1 signal.c
--- openoffice.org.orig/sal/osl/unx/signal.c	19 Jan 2007 11:43:41 -0000	1.32.14.1
+++ openoffice.org/sal/osl/unx/signal.c	18 Apr 2007 08:37:08 -0000
@@ -41,6 +41,7 @@
 
 #ifdef LINUX
 #include <execinfo.h>
+#include <link.h>
 #define INCLUDE_BACKTRACE
 #define STACKTYPE "Linux"
 #endif
@@ -393,6 +394,87 @@
 
 #define REPORTENV_PARAM		"-crashreportenv:"
 
+#ifdef LINUX
+
+typedef struct
+{
+    const char *name;
+    ElfW(Off) offset;
+} dynamic_entry;
+
+static int
+callback(struct dl_phdr_info *info, size_t size, void *data)
+{
+    const ElfW(Phdr) *pDynamic = NULL;
+
+    if (size == sizeof(struct dl_phdr_info))
+    {
+        int i;
+        for (i = 0; i < info->dlpi_phnum; ++i)
+        {
+            if (info->dlpi_phdr[i].p_type == PT_DYNAMIC)
+            {
+                pDynamic = &(info->dlpi_phdr[i]);
+                break;
+            }
+        }
+    }
+
+    if (pDynamic)
+    {
+        char buffer[100];
+        int len;
+        char exe[PATH_MAX];
+        const char *dsoname = info->dlpi_name;
+
+        dynamic_entry* entry = (dynamic_entry*)data;
+
+        if (strcmp(dsoname, "") == 0)
+        { 
+            snprintf(buffer, sizeof(buffer), "/proc/%d/exe", getpid());
+            if ((len = readlink(buffer, exe, PATH_MAX)) != -1)
+            {
+                exe[len] = '\0';
+                dsoname = exe;
+            }
+        }
+
+        if (strcmp(dsoname, entry->name) == 0)
+        {
+            entry->offset = pDynamic->p_offset;
+            return 1;
+        }
+    }
+    return 0;
+}
+
+/* Get the location of the .dynamic section offset for the given elf file.
+ * i.e. same as the "Offset" value shown for DYNAMIC from readelf -l foo 
+ *
+ * We want to know this value so that if the binaries have been modifed
+ * by prelink then we can still process the call stack on server side 
+ * by comparing this value to that of an "un-prelinked but known to be
+ * otherwise equivalent" version of those binaries and adjust the call 
+ * stack addresses by the differences between .dynamic addresses so as 
+ * to be able to map the prelinked addresses back to the unprelinked 
+ * addresses
+ *
+ * cmc at openoffice.org
+ */
+static ElfW(Off)
+dynamic_section_offset(const char *name)
+{
+    dynamic_entry entry;
+
+    entry.name = name;
+    entry.offset = 0;
+
+    dl_iterate_phdr(callback, &entry);
+
+    return entry.offset;
+}
+#endif
+
 static int ReportCrash( int Signal )
 {
 #ifdef SAL_ENABLE_CRASH_REPORT
@@ -573,6 +655,11 @@
 
 							if ( dl_info.dli_fbase && dl_info.dli_fname )
 							{
+#ifdef LINUX
+								ElfW(Off) dynamic_offset = dynamic_section_offset(dl_info.dli_fname);
+								fprintf( stackout, " 0x%" SAL_PRI_SIZET "x:", dynamic_offset);
+#endif
+
 								fprintf( stackout, " %s + 0x%" SAL_PRI_PTRDIFFT "x",
 									dl_info.dli_fname,
 									(char*)stackframes[iFrame] - (char*)dl_info.dli_fbase
@@ -584,6 +671,10 @@
 
 								if ( dli_fdir )
 									fprintf( xmlout, " path=\"%s\"", dli_fdir );
+
+#ifdef LINUX
+								fprintf( xmlout, " dynamicoffset=\"0x%" SAL_PRI_SIZET "x\"", dynamic_offset );
+#endif
 							}
 							else
 								fprintf( stackout, " ????????" );


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.1993
retrieving revision 1.1994
diff -u -p -r1.1993 -r1.1994
--- openoffice.org.spec	25 Aug 2009 11:41:23 -0000	1.1993
+++ openoffice.org.spec	26 Aug 2009 11:11:18 -0000	1.1994
@@ -89,7 +89,7 @@ Patch11: openoffice.org-2.0.3.rh127576.g
 Patch12: openoffice.org-2.2.0.ooo74188.sw.cursorinsideglyph.patch
 Patch13: ooo-build.ooo68717.gstreamer.video.patch
 Patch14: workspace.kso32fixes.patch
-Patch15: openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch
+Patch15: workspace.sb113.patch
 Patch16: openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
 Patch17: openoffice.org-2.3.0.ooo76649.httpencoding.patch
 Patch18: openoffice.org-2.3.1.ooo83878.unopkg.enablelinking.patch
@@ -1630,7 +1630,7 @@ cat %{PATCH11} >> svtools/source/dialogs
 %patch12 -p1 -b .ooo74188.sw.cursorinsideglyph.patch
 %patch13 -p0 -b .ooo68717.gstreamer.video.patch
 %patch14 -p1 -b .workspace.kso32fixes.patch
-%patch15 -p1 -b .ooo76393.sal.dynamicsection.patch
+%patch15 -p1 -b .workspace.sb113.patch
 %patch16 -p1 -b .ooo7065.sw.titlepagedialog.patch
 %patch17 -p1 -b .ooo76649.httpencoding.patch
 %patch18 -p1 -b .ooo83878.unopkg.enablelinking.patch


--- openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch DELETED ---




More information about the scm-commits mailing list