summaryrefslogtreecommitdiff
path: root/src/unexmacosx.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2014-10-12 10:35:50 +0200
committerJan Djärv <jan.h.d@swipnet.se>2014-10-12 10:35:50 +0200
commit9a265587d2f8ee034b8d00c4bcde070367fb0ad1 (patch)
treea899b66588961d5cadeff1cb03324f68a47b2b65 /src/unexmacosx.c
parent4c4c5b9121a550d006d1b57bc2ad97b0415cee9f (diff)
downloademacs-9a265587d2f8ee034b8d00c4bcde070367fb0ad1.tar.gz
emacs-9a265587d2f8ee034b8d00c4bcde070367fb0ad1.tar.bz2
emacs-9a265587d2f8ee034b8d00c4bcde070367fb0ad1.zip
Require OSX >= 10.6. Remove PowerPC unexec code.
* configure.ac: Require OSX 10.6. Remove NSInteger test, use nsfont for Gnustep, macfont for OSX. * etc/NEWS: OSX required is 10.6 or newer. * src/Makefile.in: Replace nsfont.o macfont.o with ns_fontfile in comment. * src/macfont.h (MAC_FONT_FORMAT_ATTRIBUTE, MAC_FONT_FORMAT_BITMAP) (mac_font_copy_non_synthetic_table): Remove versions for OSX < 10.6 * src/nsfns.m: Always include src/macfont.h on COCOA. (ns_filename_from_panel, ns_directory_from_panel) (Fx_create_frame, Fns_popup_font_panel, ns_run_file_dialog) (Fns_read_file_name, Fns_list_services): Remove code for OSX < 10.6 * src/nsterm.m: Always include src/macfont.h on COCOA. (ns_update_auto_hide_menu_bar, ns_draw_fringe_bitmap) (ns_dumpglyphs_image, ns_check_menu_open) (applicationDidFinishLaunching) (antialiasThresholdDidChange:) (keyDown:, toggleFullScreen:, setPosition:portion:whole:): Remove checks for OSX <= 10.5/10.6. (changeFont:): Use macfont on COCOA, nsfont on GNUSTEP. (syms_of_nsterm): Call syms_of_macfont on COCOA, syms_of_nsfont on GNUSTEP. * src/macfont.m: Remove >= 1050 check. (macfont_create_family_with_symbol) (macfont_get_glyph_for_character) (mac_font_get_glyphs_for_variants) (mac_ctfont_create_available_families, syms_of_macfont): Remove code for OSX < 10.6. (mac_font_family_group, mac_font_family_compare): Remove, only used for OSX < 10.6. * src/nsimage.m (allocInitFromFile:): Remove code for OSX < 10.6. * src/nsmenu.m (NSMenuDidBeginTrackingNotification): Remove. (x_activate_menubar, trackingNotification:): Remove check for OSX >= 10.5. (menuNeedsUpdate:): Remove check for OSX < 10.5. * src/nsterm.h (MAC_OS_X_VERSION_10_4, MAC_OS_X_VERSION_10_5): Remove. (NS_HAVE_NSINTEGER): Remove block. Remove >= OSX 10.6 tests. * src/unexmacosx.c: Remove include ppc/reloc.h. (unrelocate, copy_dysymtab): Remove PPC code. (rebase_reloc_address): Remove, only used for PPC:
Diffstat (limited to 'src/unexmacosx.c')
-rw-r--r--src/unexmacosx.c88
1 files changed, 2 insertions, 86 deletions
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 3bd8f3b02fc..2e1ac880d2a 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -107,9 +107,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <mach/mach.h>
#include <mach-o/loader.h>
#include <mach-o/reloc.h>
-#if defined (__ppc__)
-#include <mach-o/ppc/reloc.h>
-#endif
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#else
@@ -1033,17 +1030,8 @@ unrelocate (const char *name, off_t reloff, int nrel, vm_address_t base)
name, i, reloc_info.r_type);
}
else
- switch (sc_reloc_info->r_type)
- {
-#if defined (__ppc__)
- case PPC_RELOC_PB_LA_PTR:
- /* nothing to do for prebound lazy pointer */
- break;
-#endif
- default:
- unexec_error ("unrelocate: %s:%d cannot handle scattered type = %d",
- name, i, sc_reloc_info->r_type);
- }
+ unexec_error ("unrelocate: %s:%d cannot handle scattered type = %d",
+ name, i, sc_reloc_info->r_type);
}
if (nrel > 0)
@@ -1051,35 +1039,6 @@ unrelocate (const char *name, off_t reloff, int nrel, vm_address_t base)
unreloc_count, nrel, name);
}
-#if __ppc64__
-/* Rebase r_address in the relocation table. */
-static void
-rebase_reloc_address (off_t reloff, int nrel, long linkedit_delta, long diff)
-{
- int i;
- struct relocation_info reloc_info;
- struct scattered_relocation_info *sc_reloc_info
- = (struct scattered_relocation_info *) &reloc_info;
-
- for (i = 0; i < nrel; i++, reloff += sizeof (reloc_info))
- {
- if (lseek (infd, reloff - linkedit_delta, L_SET)
- != reloff - linkedit_delta)
- unexec_error ("rebase_reloc_table: cannot seek to reloc_info");
- if (!unexec_read (&reloc_info, sizeof (reloc_info)))
- unexec_error ("rebase_reloc_table: cannot read reloc_info");
-
- if (sc_reloc_info->r_scattered == 0
- && reloc_info.r_type == GENERIC_RELOC_VANILLA)
- {
- reloc_info.r_address -= diff;
- if (!unexec_write (reloff, &reloc_info, sizeof (reloc_info)))
- unexec_error ("rebase_reloc_table: cannot write reloc_info");
- }
- }
-}
-#endif
-
/* Copy a LC_DYSYMTAB load command from the input file to the output
file, adjusting the file offset fields. */
static void
@@ -1089,28 +1048,8 @@ copy_dysymtab (struct load_command *lc, long delta)
vm_address_t base;
#ifdef _LP64
-#if __ppc64__
- {
- int i;
-
- base = 0;
- for (i = 0; i < nlc; i++)
- if (lca[i]->cmd == LC_SEGMENT)
- {
- struct segment_command *scp = (struct segment_command *) lca[i];
-
- if (scp->vmaddr + scp->vmsize > 0x100000000
- && (scp->initprot & VM_PROT_WRITE) != 0)
- {
- base = data_segment_scp->vmaddr;
- break;
- }
- }
- }
-#else
/* First writable segment address. */
base = data_segment_scp->vmaddr;
-#endif
#else
/* First segment address in the file (unless MH_SPLIT_SEGS set). */
base = 0;
@@ -1136,29 +1075,6 @@ copy_dysymtab (struct load_command *lc, long delta)
unexec_error ("cannot write symtab command to header");
curr_header_offset += lc->cmdsize;
-
-#if __ppc64__
- /* Check if the relocation base needs to be changed. */
- if (base == 0)
- {
- vm_address_t newbase = 0;
- int i;
-
- for (i = 0; i < num_unexec_regions; i++)
- if (unexec_regions[i].range.address + unexec_regions[i].range.size
- > 0x100000000)
- {
- newbase = data_segment_scp->vmaddr;
- break;
- }
-
- if (newbase)
- {
- rebase_reloc_address (dstp->locreloff, dstp->nlocrel, delta, newbase);
- rebase_reloc_address (dstp->extreloff, dstp->nextrel, delta, newbase);
- }
- }
-#endif
}
/* Copy a LC_TWOLEVEL_HINTS load command from the input file to the output