summaryrefslogtreecommitdiffstats
path: root/debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-12-27 08:15:49 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-12-27 08:15:49 -0600
commitd13c79dd9536e8c57e117e5503d4c0226b0f066b (patch)
tree1af3df363921c4bbaf923b1c728b5d092ffea670 /debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff
parentf418587d09b9e5acfaadcfa88a18d0b333cf836b (diff)
downloadtde-packaging-d13c79dd9536e8c57e117e5503d4c0226b0f066b.tar.gz
tde-packaging-d13c79dd9536e8c57e117e5503d4c0226b0f066b.zip
Initial import of libr packaging files
Diffstat (limited to 'debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff')
-rw-r--r--debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff b/debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff
new file mode 100644
index 000000000..141c4c92e
--- /dev/null
+++ b/debian/lenny/dependencies/libr/debian/patches/005-fix-arm-mangled-section.diff
@@ -0,0 +1,44 @@
+Index: libr-0.6.0/src/libr-bfd.c
+===================================================================
+--- libr-0.6.0.orig/src/libr-bfd.c 2011-03-02 22:06:52.000000000 +0000
++++ libr-0.6.0/src/libr-bfd.c 2014-03-30 10:57:27.132041406 +0000
+@@ -159,7 +159,18 @@
+ continue; /* Section has been marked for deletion */
+ }
+ /* Use SEC_LINKER_CREATED to ask the libbfd backend to take care of configuring the section */
+- oscn = bfd_make_section_anyway_with_flags(ohandle, iscn->name, iscn->flags | SEC_LINKER_CREATED);
++
++ // Keep the ARM_ATTRIBUTES section type intact on armhf systems
++ // If this is not done, readelf -A will not print any architecture information for the modified library,
++ // and ldd will report that the library cannot be found
++ if (strcmp(iscn->name, ".ARM.attributes") == 0)
++ {
++ oscn = bfd_make_section_anyway_with_flags(ohandle, iscn->name, iscn->flags);
++ }
++ else
++ {
++ oscn = bfd_make_section_anyway_with_flags(ohandle, iscn->name, iscn->flags | SEC_LINKER_CREATED);
++ }
+ if(oscn == NULL)
+ {
+ printf("failed to create out section: %s\n", bfd_errmsg(bfd_get_error()));
+@@ -262,6 +273,7 @@
+ reloc_count = bfd_canonicalize_reloc(ihandle, iscn, reloc_buffer, symtab_buffer);
+ bfd_set_reloc(ohandle, oscn, reloc_buffer, reloc_count);
+ }
++
+ if(bfd_get_section_flags(ihandle, iscn) & SEC_HAS_CONTENTS)
+ {
+ /* NOTE: if the section is just being copied then do that, otherwise grab
+@@ -286,6 +298,11 @@
+ return false;
+ }
+ free(buffer);
++ if(!bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn))
++ {
++ printf("failed to copy private section data: %s\n", bfd_errmsg(bfd_get_error()));
++ return false;
++ }
+ }
+ }
+ if(!bfd_copy_private_bfd_data(ihandle, ohandle))