home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.2 / linuxelf.2 / linuxelf-1.2.13.diff
Text File  |  1995-08-03  |  82KB  |  2,899 lines

  1. diff -u --recursive --new-file linux-1.2.13/arch/i386/Makefile linux/arch/i386/Makefile
  2. --- linux-1.2.13/arch/i386/Makefile    Sat Feb 25 07:55:27 1995
  3. +++ linux/arch/i386/Makefile    Thu Aug  3 20:36:17 1995
  4. @@ -1,4 +1,12 @@
  5.  #
  6. +# We use ELF.
  7. +#
  8. +USE_ELF=yes
  9. +#
  10. +# We use a.out.
  11. +#USE_ELF=no
  12. +
  13. +#
  14.  # i386/Makefile
  15.  #
  16.  # This file is included by the global makefile so that you can add your own
  17. @@ -21,10 +29,27 @@
  18.  # ZLINKFLAGS   = -Ttext 0x1000
  19.  # LINKFLAGS    = -Ttext 0x100000
  20.  #
  21. +#
  22. +ifeq ($(USE_ELF),yes)
  23. +LD=ld -m elf_i386
  24. +CPP=$(CC) -E -D__ELF__
  25. +OBJDUMP =objdump
  26. +OBJDUMP_FLAGS=-k -q 
  27. +LDFLAGS=-e startup_32 
  28. +ZIMAGE_OFFSET=0x1000
  29. +IMAGE_OFFSET=0x100000
  30. +ZLINKFLAGS =-Ttext $(ZIMAGE_OFFSET) $(LDFLAGS)
  31. +LINKFLAGS =-Ttext $(IMAGE_OFFSET) $(LDFLAGS)
  32. +else
  33. +AS=/usr/i486-linuxaout/bin/as
  34. +LD=/usr/i486-linuxaout/bin/ld -m i386linux
  35. +CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
  36. +#
  37.  # -qmagic (we need to remove the 32 byte header for bootup purposes)
  38.  #
  39.  ZLINKFLAGS =-qmagic -Ttext 0xfe0
  40.  LINKFLAGS =-qmagic -Ttext 0xfffe0
  41. +endif
  42.  CFLAGS := $(CFLAGS) -pipe
  43.  
  44.  ifdef CONFIG_M486
  45. diff -u --recursive --new-file linux-1.2.13/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile
  46. --- linux-1.2.13/arch/i386/boot/Makefile    Tue Jan  3 05:57:26 1995
  47. +++ linux/arch/i386/boot/Makefile    Thu Aug  3 20:36:17 1995
  48. @@ -11,8 +11,17 @@
  49.  AS86    =as86 -0 -a
  50.  LD86    =ld86 -0
  51.  
  52. +ifeq ($(USE_ELF),yes)
  53. +CFLAGS := $(CFLAGS) -D__BFD__
  54. +endif
  55. +
  56.  zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
  57. +ifeq ($(USE_ELF),yes)
  58. +    $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) compressed/vmlinux > compressed/vmlinux.out
  59. +    tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zImage
  60. +else
  61.      tools/build bootsect setup compressed/vmlinux $(ROOT_DEV) > zImage
  62. +endif
  63.      sync
  64.  
  65.  compressed/vmlinux: $(TOPDIR)/vmlinux
  66. @@ -56,5 +65,5 @@
  67.  
  68.  clean:
  69.      rm -f bootsect setup
  70. -    rm -f zImage tools/build
  71. +    rm -f zImage tools/build compressed/vmlinux.out
  72.      @$(MAKE) -C compressed clean
  73. diff -u --recursive --new-file linux-1.2.13/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
  74. --- linux-1.2.13/arch/i386/boot/compressed/Makefile    Tue Jan 31 00:58:00 1995
  75. +++ linux/arch/i386/boot/compressed/Makefile    Thu Aug  3 20:36:17 1995
  76. @@ -11,6 +11,12 @@
  77.  
  78.  CFLAGS = -O2 -DSTDC_HEADERS
  79.  
  80. +ifeq ($(USE_ELF),yes)
  81. +TARGET=--target elf32-i386
  82. +INPUT_DATA=input_data
  83. +INPUT_LEN=input_len
  84. +endif
  85. +
  86.  .c.s:
  87.      $(CC) $(CFLAGS) -S $<
  88.  .s.o:
  89. @@ -20,13 +26,26 @@
  90.  
  91.  all: vmlinux
  92.  
  93. -vmlinux:    piggy.o $(OBJECTS)
  94. -        $(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
  95. +vmlinux: piggy.o $(OBJECTS)
  96. +    $(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
  97. +
  98. +#head.o:    head.s
  99.  
  100. -head.o:    head.s
  101. +head.o: head.S $(TOPDIR)/include/linux/tasks.h
  102. +    $(CC) -traditional -c head.S
  103.  
  104. -head.s: head.S $(TOPDIR)/include/linux/tasks.h
  105. -    $(CPP) -traditional head.S -o head.s
  106. +ifeq ($(USE_ELF),yes)
  107. +
  108. +# You cannot compress a file and have the kernel uncompress it, it must
  109. +# be stdin
  110. +piggy.o:    $(SYSTEM)
  111. +    tmppiggy=/tmp/$$.piggy; \
  112. +    rm -f $$tmppiggy $$tmppiggy.gz; \
  113. +    $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
  114. +    gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
  115. +    encaps $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \
  116. +    rm -f $$tmppiggy $$tmppiggy.gz
  117. +else
  118.  
  119.  piggy.o:    $(SYSTEM) xtract piggyback
  120.          ./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
  121. @@ -36,6 +55,8 @@
  122.  
  123.  piggyback: piggyback.c
  124.      $(HOSTCC) $(CFLAGS) -o piggyback piggyback.c
  125. +
  126. +endif
  127.  
  128.  clean:
  129.      rm -f xtract piggyback vmlinux
  130. diff -u --recursive --new-file linux-1.2.13/arch/i386/boot/compressed/head.S linux/arch/i386/boot/compressed/head.S
  131. --- linux-1.2.13/arch/i386/boot/compressed/head.S    Thu Dec 29 11:58:41 1994
  132. +++ linux/arch/i386/boot/compressed/head.S    Thu Aug  3 20:36:17 1995
  133. @@ -19,8 +19,10 @@
  134.  .text
  135.  
  136.  #define __ASSEMBLY__
  137. +#include <linux/linkage.h>
  138.  #include <asm/segment.h>
  139.  
  140. +    .globl startup_32
  141.  startup_32:
  142.      cld
  143.      cli
  144. @@ -29,7 +31,7 @@
  145.      mov %ax,%es
  146.      mov %ax,%fs
  147.      mov %ax,%gs
  148. -    lss _stack_start,%esp
  149. +    lss SYMBOL_NAME(stack_start),%esp
  150.      xorl %eax,%eax
  151.  1:    incl %eax        # check that A20 really IS enabled
  152.      movl %eax,0x000000    # loop forever if it isn't
  153. @@ -46,8 +48,8 @@
  154.   * Clear BSS
  155.   */
  156.      xorl %eax,%eax
  157. -    movl $__edata,%edi
  158. -    movl $__end,%ecx
  159. +    movl $ SYMBOL_NAME(_edata),%edi
  160. +    movl $ SYMBOL_NAME(_end),%ecx
  161.      subl %edi,%ecx
  162.      cld
  163.      rep
  164. @@ -55,5 +57,5 @@
  165.  /*
  166.   * Do the decompression, and jump to the new kernel..
  167.   */
  168. -    call _decompress_kernel
  169. +    call SYMBOL_NAME(decompress_kernel)
  170.      ljmp $(KERNEL_CS), $0x100000
  171. diff -u --recursive --new-file linux-1.2.13/arch/i386/boot/tools/build.c linux/arch/i386/boot/tools/build.c
  172. --- linux-1.2.13/arch/i386/boot/tools/build.c    Thu Jan  5 09:29:01 1995
  173. +++ linux/arch/i386/boot/tools/build.c    Thu Aug  3 20:36:22 1995
  174. @@ -30,11 +30,14 @@
  175.  #include <fcntl.h>
  176.  #include <linux/a.out.h>
  177.  #include <linux/config.h>
  178. +#include <errno.h>
  179.  
  180.  #define MINIX_HEADER 32
  181.  
  182.  #define N_MAGIC_OFFSET 1024
  183. +#ifndef __BFD__
  184.  static int GCC_HEADER = sizeof(struct exec);
  185. +#endif
  186.  
  187.  #define SYS_SIZE DEF_SYSSIZE
  188.  
  189. @@ -89,7 +92,9 @@
  190.      int i,c,id, sz;
  191.      unsigned long sys_size;
  192.      char buf[1024];
  193. +#ifndef __BFD__
  194.      struct exec *ex = (struct exec *)buf;
  195. +#endif
  196.      char major_root, minor_root;
  197.      struct stat sb;
  198.      unsigned char setup_sectors;
  199. @@ -190,6 +195,7 @@
  200.      
  201.      if ((id=open(argv[3],O_RDONLY,0))<0)
  202.          die("Unable to open 'system'");
  203. +#ifndef __BFD__
  204.      if (read(id,buf,GCC_HEADER) != GCC_HEADER)
  205.          die("Unable to read header of 'system'");
  206.      if (N_MAGIC(*ex) == ZMAGIC) {
  207. @@ -203,6 +209,14 @@
  208.          ex->a_data /1024,
  209.          ex->a_bss  /1024);
  210.      sz = N_SYMOFF(*ex) - GCC_HEADER + 4;
  211. +#else
  212. +    if (fstat (id, &sb)) {
  213. +      perror ("fstat");
  214. +      die ("Unable to stat 'system'");
  215. +    }
  216. +    sz = sb.st_size;
  217. +    fprintf (stderr, "System is %d kB\n", sz/1024);
  218. +#endif
  219.      sys_size = (sz + 15) / 16;
  220.      if (sys_size > SYS_SIZE)
  221.          die("System is too big");
  222. diff -u --recursive --new-file linux-1.2.13/arch/i386/ibcs/Makefile linux/arch/i386/ibcs/Makefile
  223. --- linux-1.2.13/arch/i386/ibcs/Makefile    Sun Nov 27 12:19:53 1994
  224. +++ linux/arch/i386/ibcs/Makefile    Thu Aug  3 20:36:22 1995
  225. @@ -7,6 +7,8 @@
  226.  #
  227.  # Note 2! The CFLAGS definitions are now in the main makefile...
  228.  
  229. +.S.o:
  230. +    $(CC) $(CFLAGS) -c -traditional $< -o $*.s
  231.  .S.s:
  232.      $(CPP) -traditional $< -o $*.s
  233.  .c.s:
  234. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/Makefile linux/arch/i386/kernel/Makefile
  235. --- linux-1.2.13/arch/i386/kernel/Makefile    Sun Jan 15 23:17:34 1995
  236. +++ linux/arch/i386/kernel/Makefile    Thu Aug  3 20:36:22 1995
  237. @@ -13,8 +13,8 @@
  238.      $(AS) -o $*.o $<
  239.  .c.o:
  240.      $(CC) $(CFLAGS) -c $<
  241. -.S.s:
  242. -    $(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s
  243. +#.S.s:
  244. +#    $(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s
  245.  .S.o:
  246.      $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
  247.  
  248. @@ -22,10 +22,11 @@
  249.  
  250.  all: kernel.o head.o
  251.  
  252. -head.o: head.s
  253. +#head.o: head.s
  254.  
  255. -head.s: head.S $(TOPDIR)/include/linux/tasks.h
  256. -    $(CPP) -traditional -o $*.s $<
  257. +head.o: head.S $(TOPDIR)/include/linux/tasks.h
  258. +    $(CC) -D__ASSEMBLY__ -traditional -c $*.S -o $*.o
  259. +#    $(CPP) -traditional -o $*.s $<
  260.  
  261.  kernel.o: $(OBJS)
  262.      $(LD) -r -o kernel.o $(OBJS)
  263. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
  264. --- linux-1.2.13/arch/i386/kernel/entry.S    Tue Jan  3 07:15:08 1995
  265. +++ linux/arch/i386/kernel/entry.S    Thu Aug  3 20:36:22 1995
  266. @@ -41,6 +41,7 @@
  267.   */
  268.  
  269.  #include <linux/sys.h>
  270. +#include <linux/linkage.h>
  271.  #include <asm/segment.h>
  272.  
  273.  EBX        = 0x00
  274. @@ -82,15 +83,6 @@
  275.  
  276.  ENOSYS = 38
  277.  
  278. -.globl _system_call,_lcall7
  279. -.globl _device_not_available, _coprocessor_error
  280. -.globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op
  281. -.globl _double_fault,_coprocessor_segment_overrun
  282. -.globl _invalid_TSS,_segment_not_present,_stack_segment
  283. -.globl _general_protection,_reserved
  284. -.globl _alignment_check,_page_fault
  285. -.globl ret_from_sys_call, _sys_call_table
  286. -
  287.  #define SAVE_ALL \
  288.      cld; \
  289.      push %gs; \
  290. @@ -113,7 +105,7 @@
  291.  #define RESTORE_ALL \
  292.      cmpw $(KERNEL_CS),CS(%esp); \
  293.      je 1f;   \
  294. -    movl _current,%eax; \
  295. +    movl SYMBOL_NAME(current),%eax; \
  296.      movl dbgreg7(%eax),%ebx; \
  297.      movl %ebx,%db7;    \
  298.  1:    popl %ebx; \
  299. @@ -130,8 +122,7 @@
  300.      addl $4,%esp; \
  301.      iret
  302.  
  303. -.align 4
  304. -_lcall7:
  305. +ENTRY(lcall7)
  306.      pushfl            # We get a different stack layout with call gates,
  307.      pushl %eax        # which has to be cleaned up later..
  308.      SAVE_ALL
  309. @@ -142,7 +133,7 @@
  310.      movl %edx,EIP(%esp)    # Now we move them to their "normal" places
  311.      movl %ecx,CS(%esp)    #
  312.      movl %esp,%eax
  313. -    movl _current,%edx
  314. +    movl SYMBOL_NAME(current),%edx
  315.      pushl %eax
  316.      movl exec_domain(%edx),%edx    # Get the execution domain
  317.      movl 4(%edx),%edx    # Get the lcall7 handler for the domain
  318. @@ -150,30 +141,30 @@
  319.      popl %eax
  320.      jmp ret_from_sys_call
  321.  
  322. -.align 4
  323. +    ALIGN
  324.  handle_bottom_half:
  325.      pushfl
  326. -    incl _intr_count
  327. +    incl SYMBOL_NAME(intr_count)
  328.      sti
  329. -    call _do_bottom_half
  330. +    call SYMBOL_NAME(do_bottom_half)
  331.      popfl
  332. -    decl _intr_count
  333. +    decl SYMBOL_NAME(intr_count)
  334.      jmp 9f
  335. -.align 4
  336. +    ALIGN
  337.  reschedule:
  338.      pushl $ret_from_sys_call
  339. -    jmp _schedule
  340. -.align 4
  341. -_system_call:
  342. +    jmp SYMBOL_NAME(schedule)
  343. +
  344. +ENTRY(system_call)
  345.      pushl %eax            # save orig_eax
  346.      SAVE_ALL
  347.      movl $-ENOSYS,EAX(%esp)
  348.      cmpl $(NR_syscalls),%eax
  349.      jae ret_from_sys_call
  350. -    movl _sys_call_table(,%eax,4),%eax
  351. +    movl SYMBOL_NAME(sys_call_table)(,%eax,4),%eax
  352.      testl %eax,%eax
  353.      je ret_from_sys_call
  354. -    movl _current,%ebx
  355. +    movl SYMBOL_NAME(current),%ebx
  356.      andl $~CF_MASK,EFLAGS(%esp)    # clear carry - assume no errors
  357.      movl $0,errno(%ebx)
  358.      movl %db6,%edx
  359. @@ -188,25 +179,26 @@
  360.      movl %edx,EAX(%esp)
  361.      orl $(CF_MASK),EFLAGS(%esp)    # set carry to indicate error
  362.      jmp ret_from_sys_call
  363. -.align 4
  364. -1:    call _syscall_trace
  365. +    ALIGN
  366. +1:    call SYMBOL_NAME(syscall_trace)
  367.      movl ORIG_EAX(%esp),%eax
  368. -    call _sys_call_table(,%eax,4)
  369. +    call SYMBOL_NAME(sys_call_table)(,%eax,4)
  370.      movl %eax,EAX(%esp)        # save the return value
  371. -    movl _current,%eax
  372. +    movl SYMBOL_NAME(current),%eax
  373.      movl errno(%eax),%edx
  374.      negl %edx
  375.      je 1f
  376.      movl %edx,EAX(%esp)
  377.      orl $(CF_MASK),EFLAGS(%esp)    # set carry to indicate error
  378. -1:    call _syscall_trace
  379. +1:    call SYMBOL_NAME(syscall_trace)
  380.  
  381. -    .align 4,0x90
  382. +    ALIGN
  383. +    .globl ret_from_sys_call
  384.  ret_from_sys_call:
  385. -    cmpl $0,_intr_count
  386. +    cmpl $0,SYMBOL_NAME(intr_count)
  387.      jne 2f
  388. -9:    movl _bh_mask,%eax
  389. -    andl _bh_active,%eax
  390. +9:    movl SYMBOL_NAME(bh_mask),%eax
  391. +    andl SYMBOL_NAME(bh_active),%eax
  392.      jne handle_bottom_half
  393.      movl EFLAGS(%esp),%eax        # check VM86 flag: CS/SS are
  394.      testl $(VM_MASK),%eax        # different then
  395. @@ -217,10 +209,10 @@
  396.      orl $(IF_MASK),%eax        # these just try to make sure
  397.      andl $~NT_MASK,%eax        # the program doesn't do anything
  398.      movl %eax,EFLAGS(%esp)        # stupid
  399. -    cmpl $0,_need_resched
  400. +    cmpl $0,SYMBOL_NAME(need_resched)
  401.      jne reschedule
  402. -    movl _current,%eax
  403. -    cmpl _task,%eax            # task[0] cannot have signals
  404. +    movl SYMBOL_NAME(current),%eax
  405. +    cmpl SYMBOL_NAME(task),%eax    # task[0] cannot have signals
  406.      je 2f
  407.      cmpl $0,state(%eax)        # state
  408.      jne reschedule
  409. @@ -232,33 +224,32 @@
  410.      andl signal(%eax),%ecx
  411.      jne signal_return
  412.  2:    RESTORE_ALL
  413. -.align 4
  414. +    ALIGN
  415.  signal_return:
  416.      movl %esp,%ecx
  417.      pushl %ecx
  418.      testl $(VM_MASK),EFLAGS(%ecx)
  419.      jne v86_signal_return
  420.      pushl %ebx
  421. -    call _do_signal
  422. +    call SYMBOL_NAME(do_signal)
  423.      popl %ebx
  424.      popl %ebx
  425.      RESTORE_ALL
  426. -.align 4
  427. +    ALIGN
  428.  v86_signal_return:
  429. -    call _save_v86_state
  430. +    call SYMBOL_NAME(save_v86_state)
  431.      movl %eax,%esp
  432.      pushl %eax
  433.      pushl %ebx
  434. -    call _do_signal
  435. +    call SYMBOL_NAME(do_signal)
  436.      popl %ebx
  437.      popl %ebx
  438.      RESTORE_ALL
  439.  
  440. -.align 4
  441. -_divide_error:
  442. +ENTRY(divide_error)
  443.      pushl $0        # no error code
  444. -    pushl $_do_divide_error
  445. -.align 4,0x90
  446. +    pushl $ SYMBOL_NAME(do_divide_error)
  447. +    ALIGN
  448.  error_code:
  449.      push %fs
  450.      push %es
  451. @@ -287,7 +278,7 @@
  452.      movl $(USER_DS),%edx
  453.      mov %dx,%fs
  454.      pushl %eax
  455. -    movl _current,%eax
  456. +    movl SYMBOL_NAME(current),%eax
  457.      movl %db6,%edx
  458.      movl %edx,dbgreg6(%eax)  # save current hardware debugging status
  459.      popl %eax
  460. @@ -295,250 +286,232 @@
  461.      addl $8,%esp
  462.      jmp ret_from_sys_call
  463.  
  464. -.align 4
  465. -_coprocessor_error:
  466. +ENTRY(coprocessor_error)
  467.      pushl $0
  468. -    pushl $_do_coprocessor_error
  469. +    pushl $ SYMBOL_NAME(do_coprocessor_error)
  470.      jmp error_code
  471.  
  472. -.align 4
  473. -_device_not_available:
  474. +ENTRY(device_not_available)
  475.      pushl $-1        # mark this as an int
  476.      SAVE_ALL
  477.      pushl $ret_from_sys_call
  478.      movl %cr0,%eax
  479.      testl $0x4,%eax            # EM (math emulation bit)
  480. -    je _math_state_restore
  481. +    je  SYMBOL_NAME(math_state_restore)
  482.      pushl $0        # temporary storage for ORIG_EIP
  483. -    call _math_emulate
  484. +    call  SYMBOL_NAME(math_emulate)
  485.      addl $4,%esp
  486.      ret
  487.  
  488. -.align 4
  489. -_debug:
  490. +ENTRY(debug)
  491.      pushl $0
  492. -    pushl $_do_debug
  493. +    pushl $ SYMBOL_NAME(do_debug)
  494.      jmp error_code
  495.  
  496. -.align 4
  497. -_nmi:
  498. +ENTRY(nmi)
  499.      pushl $0
  500. -    pushl $_do_nmi
  501. +    pushl $ SYMBOL_NAME(do_nmi)
  502.      jmp error_code
  503.  
  504. -.align 4
  505. -_int3:
  506. +ENTRY(int3)
  507.      pushl $0
  508. -    pushl $_do_int3
  509. +    pushl $ SYMBOL_NAME(do_int3)
  510.      jmp error_code
  511.  
  512. -.align 4
  513. -_overflow:
  514. +ENTRY(overflow)
  515.      pushl $0
  516. -    pushl $_do_overflow
  517. +    pushl $ SYMBOL_NAME(do_overflow)
  518.      jmp error_code
  519.  
  520. -.align 4
  521. -_bounds:
  522. +ENTRY(bounds)
  523.      pushl $0
  524. -    pushl $_do_bounds
  525. +    pushl $ SYMBOL_NAME(do_bounds)
  526.      jmp error_code
  527.  
  528. -.align 4
  529. -_invalid_op:
  530. +ENTRY(invalid_op)
  531.      pushl $0
  532. -    pushl $_do_invalid_op
  533. +    pushl $ SYMBOL_NAME(do_invalid_op)
  534.      jmp error_code
  535.  
  536. -.align 4
  537. -_coprocessor_segment_overrun:
  538. +ENTRY(coprocessor_segment_overrun)
  539.      pushl $0
  540. -    pushl $_do_coprocessor_segment_overrun
  541. +    pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
  542.      jmp error_code
  543.  
  544. -.align 4
  545. -_reserved:
  546. +ENTRY(reserved)
  547.      pushl $0
  548. -    pushl $_do_reserved
  549. +    pushl $ SYMBOL_NAME(do_reserved)
  550.      jmp error_code
  551.  
  552. -.align 4
  553. -_double_fault:
  554. -    pushl $_do_double_fault
  555. +ENTRY(double_fault)
  556. +    pushl $ SYMBOL_NAME(do_double_fault)
  557.      jmp error_code
  558.  
  559. -.align 4
  560. -_invalid_TSS:
  561. -    pushl $_do_invalid_TSS
  562. +ENTRY(invalid_TSS)
  563. +    pushl $ SYMBOL_NAME(do_invalid_TSS)
  564.      jmp error_code
  565.  
  566. -.align 4
  567. -_segment_not_present:
  568. -    pushl $_do_segment_not_present
  569. +ENTRY(segment_not_present)
  570. +    pushl $ SYMBOL_NAME(do_segment_not_present)
  571.      jmp error_code
  572.  
  573. -.align 4
  574. -_stack_segment:
  575. -    pushl $_do_stack_segment
  576. +ENTRY(stack_segment)
  577. +    pushl $ SYMBOL_NAME(do_stack_segment)
  578.      jmp error_code
  579.  
  580. -.align 4
  581. -_general_protection:
  582. -    pushl $_do_general_protection
  583. +ENTRY(general_protection)
  584. +    pushl $ SYMBOL_NAME(do_general_protection)
  585.      jmp error_code
  586.  
  587. -.align 4
  588. -_alignment_check:
  589. -    pushl $_do_alignment_check
  590. +ENTRY(alignment_check)
  591. +    pushl $ SYMBOL_NAME(do_alignment_check)
  592.      jmp error_code
  593.  
  594. -.align 4
  595. -_page_fault:
  596. -    pushl $_do_page_fault
  597. +ENTRY(page_fault)
  598. +    pushl $ SYMBOL_NAME(do_page_fault)
  599.      jmp error_code
  600.  
  601.  .data
  602. -.align 4
  603. -_sys_call_table:
  604. -    .long _sys_setup        /* 0 */
  605. -    .long _sys_exit
  606. -    .long _sys_fork
  607. -    .long _sys_read
  608. -    .long _sys_write
  609. -    .long _sys_open            /* 5 */
  610. -    .long _sys_close
  611. -    .long _sys_waitpid
  612. -    .long _sys_creat
  613. -    .long _sys_link
  614. -    .long _sys_unlink        /* 10 */
  615. -    .long _sys_execve
  616. -    .long _sys_chdir
  617. -    .long _sys_time
  618. -    .long _sys_mknod
  619. -    .long _sys_chmod        /* 15 */
  620. -    .long _sys_chown
  621. -    .long _sys_break
  622. -    .long _sys_stat
  623. -    .long _sys_lseek
  624. -    .long _sys_getpid        /* 20 */
  625. -    .long _sys_mount
  626. -    .long _sys_umount
  627. -    .long _sys_setuid
  628. -    .long _sys_getuid
  629. -    .long _sys_stime        /* 25 */
  630. -    .long _sys_ptrace
  631. -    .long _sys_alarm
  632. -    .long _sys_fstat
  633. -    .long _sys_pause
  634. -    .long _sys_utime        /* 30 */
  635. -    .long _sys_stty
  636. -    .long _sys_gtty
  637. -    .long _sys_access
  638. -    .long _sys_nice
  639. -    .long _sys_ftime        /* 35 */
  640. -    .long _sys_sync
  641. -    .long _sys_kill
  642. -    .long _sys_rename
  643. -    .long _sys_mkdir
  644. -    .long _sys_rmdir        /* 40 */
  645. -    .long _sys_dup
  646. -    .long _sys_pipe
  647. -    .long _sys_times
  648. -    .long _sys_prof
  649. -    .long _sys_brk            /* 45 */
  650. -    .long _sys_setgid
  651. -    .long _sys_getgid
  652. -    .long _sys_signal
  653. -    .long _sys_geteuid
  654. -    .long _sys_getegid        /* 50 */
  655. -    .long _sys_acct
  656. -    .long _sys_phys
  657. -    .long _sys_lock
  658. -    .long _sys_ioctl
  659. -    .long _sys_fcntl        /* 55 */
  660. -    .long _sys_mpx
  661. -    .long _sys_setpgid
  662. -    .long _sys_ulimit
  663. -    .long _sys_olduname
  664. -    .long _sys_umask        /* 60 */
  665. -    .long _sys_chroot
  666. -    .long _sys_ustat
  667. -    .long _sys_dup2
  668. -    .long _sys_getppid
  669. -    .long _sys_getpgrp        /* 65 */
  670. -    .long _sys_setsid
  671. -    .long _sys_sigaction
  672. -    .long _sys_sgetmask
  673. -    .long _sys_ssetmask
  674. -    .long _sys_setreuid        /* 70 */
  675. -    .long _sys_setregid
  676. -    .long _sys_sigsuspend
  677. -    .long _sys_sigpending
  678. -    .long _sys_sethostname
  679. -    .long _sys_setrlimit        /* 75 */
  680. -    .long _sys_getrlimit
  681. -    .long _sys_getrusage
  682. -    .long _sys_gettimeofday
  683. -    .long _sys_settimeofday
  684. -    .long _sys_getgroups        /* 80 */
  685. -    .long _sys_setgroups
  686. -    .long _sys_select
  687. -    .long _sys_symlink
  688. -    .long _sys_lstat
  689. -    .long _sys_readlink        /* 85 */
  690. -    .long _sys_uselib
  691. -    .long _sys_swapon
  692. -    .long _sys_reboot
  693. -    .long _sys_readdir
  694. -    .long _sys_mmap            /* 90 */
  695. -    .long _sys_munmap
  696. -    .long _sys_truncate
  697. -    .long _sys_ftruncate
  698. -    .long _sys_fchmod
  699. -    .long _sys_fchown        /* 95 */
  700. -    .long _sys_getpriority
  701. -    .long _sys_setpriority
  702. -    .long _sys_profil
  703. -    .long _sys_statfs
  704. -    .long _sys_fstatfs        /* 100 */
  705. -    .long _sys_ioperm
  706. -    .long _sys_socketcall
  707. -    .long _sys_syslog
  708. -    .long _sys_setitimer
  709. -    .long _sys_getitimer        /* 105 */
  710. -    .long _sys_newstat
  711. -    .long _sys_newlstat
  712. -    .long _sys_newfstat
  713. -    .long _sys_uname
  714. -    .long _sys_iopl            /* 110 */
  715. -    .long _sys_vhangup
  716. -    .long _sys_idle
  717. -    .long _sys_vm86
  718. -    .long _sys_wait4
  719. -    .long _sys_swapoff        /* 115 */
  720. -    .long _sys_sysinfo
  721. -    .long _sys_ipc
  722. -    .long _sys_fsync
  723. -    .long _sys_sigreturn
  724. -    .long _sys_clone        /* 120 */
  725. -    .long _sys_setdomainname
  726. -    .long _sys_newuname
  727. -    .long _sys_modify_ldt
  728. -    .long _sys_adjtimex
  729. -    .long _sys_mprotect        /* 125 */
  730. -    .long _sys_sigprocmask
  731. -    .long _sys_create_module
  732. -    .long _sys_init_module
  733. -    .long _sys_delete_module
  734. -    .long _sys_get_kernel_syms    /* 130 */
  735. -    .long _sys_quotactl
  736. -    .long _sys_getpgid
  737. -    .long _sys_fchdir
  738. -    .long _sys_bdflush
  739. -    .long _sys_sysfs        /* 135 */
  740. -    .long _sys_personality
  741. +ENTRY(sys_call_table)
  742. +    .long SYMBOL_NAME(sys_setup)        /* 0 */
  743. +    .long SYMBOL_NAME(sys_exit)
  744. +    .long SYMBOL_NAME(sys_fork)
  745. +    .long SYMBOL_NAME(sys_read)
  746. +    .long SYMBOL_NAME(sys_write)
  747. +    .long SYMBOL_NAME(sys_open)        /* 5 */
  748. +    .long SYMBOL_NAME(sys_close)
  749. +    .long SYMBOL_NAME(sys_waitpid)
  750. +    .long SYMBOL_NAME(sys_creat)
  751. +    .long SYMBOL_NAME(sys_link)
  752. +    .long SYMBOL_NAME(sys_unlink)        /* 10 */
  753. +    .long SYMBOL_NAME(sys_execve)
  754. +    .long SYMBOL_NAME(sys_chdir)
  755. +    .long SYMBOL_NAME(sys_time)
  756. +    .long SYMBOL_NAME(sys_mknod)
  757. +    .long SYMBOL_NAME(sys_chmod)        /* 15 */
  758. +    .long SYMBOL_NAME(sys_chown)
  759. +    .long SYMBOL_NAME(sys_break)
  760. +    .long SYMBOL_NAME(sys_stat)
  761. +    .long SYMBOL_NAME(sys_lseek)
  762. +    .long SYMBOL_NAME(sys_getpid)        /* 20 */
  763. +    .long SYMBOL_NAME(sys_mount)
  764. +    .long SYMBOL_NAME(sys_umount)
  765. +    .long SYMBOL_NAME(sys_setuid)
  766. +    .long SYMBOL_NAME(sys_getuid)
  767. +    .long SYMBOL_NAME(sys_stime)        /* 25 */
  768. +    .long SYMBOL_NAME(sys_ptrace)
  769. +    .long SYMBOL_NAME(sys_alarm)
  770. +    .long SYMBOL_NAME(sys_fstat)
  771. +    .long SYMBOL_NAME(sys_pause)
  772. +    .long SYMBOL_NAME(sys_utime)        /* 30 */
  773. +    .long SYMBOL_NAME(sys_stty)
  774. +    .long SYMBOL_NAME(sys_gtty)
  775. +    .long SYMBOL_NAME(sys_access)
  776. +    .long SYMBOL_NAME(sys_nice)
  777. +    .long SYMBOL_NAME(sys_ftime)        /* 35 */
  778. +    .long SYMBOL_NAME(sys_sync)
  779. +    .long SYMBOL_NAME(sys_kill)
  780. +    .long SYMBOL_NAME(sys_rename)
  781. +    .long SYMBOL_NAME(sys_mkdir)
  782. +    .long SYMBOL_NAME(sys_rmdir)        /* 40 */
  783. +    .long SYMBOL_NAME(sys_dup)
  784. +    .long SYMBOL_NAME(sys_pipe)
  785. +    .long SYMBOL_NAME(sys_times)
  786. +    .long SYMBOL_NAME(sys_prof)
  787. +    .long SYMBOL_NAME(sys_brk)        /* 45 */
  788. +    .long SYMBOL_NAME(sys_setgid)
  789. +    .long SYMBOL_NAME(sys_getgid)
  790. +    .long SYMBOL_NAME(sys_signal)
  791. +    .long SYMBOL_NAME(sys_geteuid)
  792. +    .long SYMBOL_NAME(sys_getegid)        /* 50 */
  793. +    .long SYMBOL_NAME(sys_acct)
  794. +    .long SYMBOL_NAME(sys_phys)
  795. +    .long SYMBOL_NAME(sys_lock)
  796. +    .long SYMBOL_NAME(sys_ioctl)
  797. +    .long SYMBOL_NAME(sys_fcntl)        /* 55 */
  798. +    .long SYMBOL_NAME(sys_mpx)
  799. +    .long SYMBOL_NAME(sys_setpgid)
  800. +    .long SYMBOL_NAME(sys_ulimit)
  801. +    .long SYMBOL_NAME(sys_olduname)
  802. +    .long SYMBOL_NAME(sys_umask)        /* 60 */
  803. +    .long SYMBOL_NAME(sys_chroot)
  804. +    .long SYMBOL_NAME(sys_ustat)
  805. +    .long SYMBOL_NAME(sys_dup2)
  806. +    .long SYMBOL_NAME(sys_getppid)
  807. +    .long SYMBOL_NAME(sys_getpgrp)        /* 65 */
  808. +    .long SYMBOL_NAME(sys_setsid)
  809. +    .long SYMBOL_NAME(sys_sigaction)
  810. +    .long SYMBOL_NAME(sys_sgetmask)
  811. +    .long SYMBOL_NAME(sys_ssetmask)
  812. +    .long SYMBOL_NAME(sys_setreuid)        /* 70 */
  813. +    .long SYMBOL_NAME(sys_setregid)
  814. +    .long SYMBOL_NAME(sys_sigsuspend)
  815. +    .long SYMBOL_NAME(sys_sigpending)
  816. +    .long SYMBOL_NAME(sys_sethostname)
  817. +    .long SYMBOL_NAME(sys_setrlimit)    /* 75 */
  818. +    .long SYMBOL_NAME(sys_getrlimit)
  819. +    .long SYMBOL_NAME(sys_getrusage)
  820. +    .long SYMBOL_NAME(sys_gettimeofday)
  821. +    .long SYMBOL_NAME(sys_settimeofday)
  822. +    .long SYMBOL_NAME(sys_getgroups)    /* 80 */
  823. +    .long SYMBOL_NAME(sys_setgroups)
  824. +    .long SYMBOL_NAME(sys_select)
  825. +    .long SYMBOL_NAME(sys_symlink)
  826. +    .long SYMBOL_NAME(sys_lstat)
  827. +    .long SYMBOL_NAME(sys_readlink)        /* 85 */
  828. +    .long SYMBOL_NAME(sys_uselib)
  829. +    .long SYMBOL_NAME(sys_swapon)
  830. +    .long SYMBOL_NAME(sys_reboot)
  831. +    .long SYMBOL_NAME(sys_readdir)
  832. +    .long SYMBOL_NAME(sys_mmap)        /* 90 */
  833. +    .long SYMBOL_NAME(sys_munmap)
  834. +    .long SYMBOL_NAME(sys_truncate)
  835. +    .long SYMBOL_NAME(sys_ftruncate)
  836. +    .long SYMBOL_NAME(sys_fchmod)
  837. +    .long SYMBOL_NAME(sys_fchown)        /* 95 */
  838. +    .long SYMBOL_NAME(sys_getpriority)
  839. +    .long SYMBOL_NAME(sys_setpriority)
  840. +    .long SYMBOL_NAME(sys_profil)
  841. +    .long SYMBOL_NAME(sys_statfs)
  842. +    .long SYMBOL_NAME(sys_fstatfs)        /* 100 */
  843. +    .long SYMBOL_NAME(sys_ioperm)
  844. +    .long SYMBOL_NAME(sys_socketcall)
  845. +    .long SYMBOL_NAME(sys_syslog)
  846. +    .long SYMBOL_NAME(sys_setitimer)
  847. +    .long SYMBOL_NAME(sys_getitimer)    /* 105 */
  848. +    .long SYMBOL_NAME(sys_newstat)
  849. +    .long SYMBOL_NAME(sys_newlstat)
  850. +    .long SYMBOL_NAME(sys_newfstat)
  851. +    .long SYMBOL_NAME(sys_uname)
  852. +    .long SYMBOL_NAME(sys_iopl)        /* 110 */
  853. +    .long SYMBOL_NAME(sys_vhangup)
  854. +    .long SYMBOL_NAME(sys_idle)
  855. +    .long SYMBOL_NAME(sys_vm86)
  856. +    .long SYMBOL_NAME(sys_wait4)
  857. +    .long SYMBOL_NAME(sys_swapoff)        /* 115 */
  858. +    .long SYMBOL_NAME(sys_sysinfo)
  859. +    .long SYMBOL_NAME(sys_ipc)
  860. +    .long SYMBOL_NAME(sys_fsync)
  861. +    .long SYMBOL_NAME(sys_sigreturn)
  862. +    .long SYMBOL_NAME(sys_clone)        /* 120 */
  863. +    .long SYMBOL_NAME(sys_setdomainname)
  864. +    .long SYMBOL_NAME(sys_newuname)
  865. +    .long SYMBOL_NAME(sys_modify_ldt)
  866. +    .long SYMBOL_NAME(sys_adjtimex)
  867. +    .long SYMBOL_NAME(sys_mprotect)        /* 125 */
  868. +    .long SYMBOL_NAME(sys_sigprocmask)
  869. +    .long SYMBOL_NAME(sys_create_module)
  870. +    .long SYMBOL_NAME(sys_init_module)
  871. +    .long SYMBOL_NAME(sys_delete_module)
  872. +    .long SYMBOL_NAME(sys_get_kernel_syms)    /* 130 */
  873. +    .long SYMBOL_NAME(sys_quotactl)
  874. +    .long SYMBOL_NAME(sys_getpgid)
  875. +    .long SYMBOL_NAME(sys_fchdir)
  876. +    .long SYMBOL_NAME(sys_bdflush)
  877. +    .long SYMBOL_NAME(sys_sysfs)        /* 135 */
  878. +    .long SYMBOL_NAME(sys_personality)
  879.      .long 0                /* for afs_syscall */
  880. -    .long _sys_setfsuid
  881. -    .long _sys_setfsgid
  882. -    .long _sys_llseek        /* 140 */
  883. +    .long SYMBOL_NAME(sys_setfsuid)
  884. +    .long SYMBOL_NAME(sys_setfsgid)
  885. +    .long SYMBOL_NAME(sys_llseek)        /* 140 */
  886.      .space (NR_syscalls-140)*4
  887. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/head.S linux/arch/i386/kernel/head.S
  888. --- linux-1.2.13/arch/i386/kernel/head.S    Mon Jan  2 07:19:59 1995
  889. +++ linux/arch/i386/kernel/head.S    Thu Aug  3 20:36:22 1995
  890. @@ -9,16 +9,10 @@
  891.   */
  892.  
  893.  .text
  894. -.globl _idt,_gdt,
  895. -.globl _swapper_pg_dir,_pg0
  896. -.globl _empty_bad_page
  897. -.globl _empty_bad_page_table
  898. -.globl _empty_zero_page
  899. -.globl _floppy_track_buffer
  900.  
  901. -#define __ASSEMBLY__
  902.  #include <linux/tasks.h>
  903.  #include <linux/fd.h>
  904. +#include <linux/linkage.h>
  905.  #include <asm/segment.h>
  906.  
  907.  #define CL_MAGIC_ADDR    0x90020
  908. @@ -30,6 +24,7 @@
  909.   * swapper_pg_dir is the main page directory, address 0x00001000 (or at
  910.   * address 0x00101000 for a compressed boot).
  911.   */
  912. +    .globl startup_32
  913.  startup_32:
  914.      cld
  915.      movl $(KERNEL_DS),%eax
  916. @@ -42,8 +37,8 @@
  917.   * Clear BSS first so that there are no surprises...
  918.   */
  919.      xorl %eax,%eax
  920. -    movl $__edata,%edi
  921. -    movl $__end,%ecx
  922. +    movl $ SYMBOL_NAME(_edata),%edi
  923. +    movl $ SYMBOL_NAME(_end),%ecx
  924.      subl %edi,%ecx
  925.      cld
  926.      rep
  927. @@ -71,7 +66,7 @@
  928.   * is for the command line.
  929.   */
  930.      movl $0x90000,%esi
  931. -    movl $_empty_zero_page,%edi
  932. +    movl $ SYMBOL_NAME(empty_zero_page),%edi
  933.      movl $512,%ecx
  934.      cld
  935.      rep
  936. @@ -82,7 +77,7 @@
  937.      stosl
  938.      cmpw $(CL_MAGIC),CL_MAGIC_ADDR
  939.      jne 1f
  940. -    movl $_empty_zero_page+2048,%edi
  941. +    movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi
  942.      movzwl CL_OFFSET,%esi
  943.      addl $(CL_BASE_ADDR),%esi
  944.      movl $2048,%ecx
  945. @@ -95,7 +90,7 @@
  946.   * apply at our cpl of 0 and the stack ought to be aligned already, and
  947.   * we don't need to preserve eflags.
  948.   */
  949. -    movl $3,_x86
  950. +    movl $3, SYMBOL_NAME(x86)
  951.      pushfl            # push EFLAGS
  952.      popl %eax        # get EFLAGS
  953.      movl %eax,%ecx        # save original EFLAGS
  954. @@ -107,7 +102,7 @@
  955.      xorl %ecx,%eax        # change in flags
  956.      andl $0x40000,%eax    # check if AC bit changed
  957.      je is386
  958. -    movl $4,_x86
  959. +    movl $4,SYMBOL_NAME(x86)
  960.      movl %ecx,%eax
  961.      xorl $0x200000,%eax    # check ID flag
  962.      pushl %eax
  963. @@ -124,19 +119,19 @@
  964.      .byte 0x0f, 0xa2    # check the processor type
  965.      movb %al, %cl        # save reg for future use
  966.      andb $0x0f,%ah        # mask processor family
  967. -    movb %ah, _x86
  968. +    movb %ah,SYMBOL_NAME(x86)
  969.      andb $0xf0, %eax    # mask model
  970.      shrb $4, %al
  971. -    movb %al, _x86_model
  972. +    movb %al,SYMBOL_NAME(x86_model)
  973.      andb $0x0f, %cl        # mask mask revision
  974. -    movb %cl, _x86_mask
  975. -    movl %edx, _x86_capability
  976. +    movb %cl,SYMBOL_NAME(x86_mask)
  977. +    movl %edx,SYMBOL_NAME(x86_capability)
  978.      /* get vendor info */
  979.      xorl %eax, %eax            # call CPUID with 0 -> return vendor ID
  980.      .byte 0x0f, 0xa2        # CPUID
  981. -    movl %ebx, _x86_vendor_id    # lo 4 chars
  982. -    movl %edx, _x86_vendor_id+4    # next 4 chars
  983. -    movl %ecx, _x86_vendor_id+8    # last 4 chars
  984. +    movl %ebx,SYMBOL_NAME(x86_vendor_id)    # lo 4 chars
  985. +    movl %edx,SYMBOL_NAME(x86_vendor_id)+4    # next 4 chars
  986. +    movl %ecx,SYMBOL_NAME(x86_vendor_id)+8    # last 4 chars
  987.  
  988.      movl %cr0,%eax        # 486+
  989.      andl $0x80000011,%eax    # Save PG,PE,ET
  990. @@ -171,7 +166,7 @@
  991.      pushl %eax
  992.      pushl %eax
  993.      cld            # gcc2 wants the direction flag cleared at all times
  994. -    call _start_kernel
  995. +    call SYMBOL_NAME(start_kernel)
  996.  L6:
  997.      jmp L6            # main should never return here, but
  998.                  # just in case, we know what happens.
  999. @@ -180,7 +175,7 @@
  1000.   * We depend on ET to be correct. This checks for 287/387.
  1001.   */
  1002.  check_x87:
  1003. -    movb $0,_hard_math
  1004. +    movb $0,SYMBOL_NAME(hard_math)
  1005.      clts
  1006.      fninit
  1007.      fstsw %ax
  1008. @@ -190,8 +185,8 @@
  1009.      xorl $4,%eax        /* set EM */
  1010.      movl %eax,%cr0
  1011.      ret
  1012. -.align 2
  1013. -1:    movb $1,_hard_math
  1014. +    ALIGN
  1015. +1:    movb $1,SYMBOL_NAME(hard_math)
  1016.      .byte 0xDB,0xE4        /* fsetpm for 287, ignored by 387 */
  1017.      ret
  1018.  
  1019. @@ -211,7 +206,7 @@
  1020.      movw %dx,%ax        /* selector = 0x0010 = cs */
  1021.      movw $0x8E00,%dx    /* interrupt gate - dpl=0, present */
  1022.  
  1023. -    lea _idt,%edi
  1024. +    lea SYMBOL_NAME(idt),%edi
  1025.      mov $256,%ecx
  1026.  rp_sidt:
  1027.      movl %eax,(%edi)
  1028. @@ -233,24 +228,26 @@
  1029.   * (ref: update, 25Sept92)  -- croutons@crunchy.uucp 
  1030.   * (ref: 92.10.11 - Linus Torvalds. Corrected 16M limit - no upper memory limit)
  1031.   */
  1032. -.align 2
  1033. +    ALIGN
  1034.  setup_paging:
  1035.      movl $1024*2,%ecx        /* 2 pages - swapper_pg_dir+1 page table */
  1036.      xorl %eax,%eax
  1037. -    movl $_swapper_pg_dir,%edi    /* swapper_pg_dir is at 0x1000 */
  1038. +    movl $ SYMBOL_NAME(swapper_pg_dir),%edi    /* swapper_pg_dir is at 0x1000 */
  1039.      cld;rep;stosl
  1040.  /* Identity-map the kernel in low 4MB memory for ease of transition */
  1041. -    movl $_pg0+7,_swapper_pg_dir        /* set present bit/user r/w */
  1042. +/* set present bit/user r/w */
  1043. +    movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir)
  1044.  /* But the real place is at 0xC0000000 */
  1045. -    movl $_pg0+7,_swapper_pg_dir+3072    /* set present bit/user r/w */
  1046. -    movl $_pg0+4092,%edi
  1047. +/* set present bit/user r/w */
  1048. +    movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir)+3072
  1049. +    movl $ SYMBOL_NAME(pg0)+4092,%edi
  1050.      movl $0x03ff007,%eax        /*  4Mb - 4096 + 7 (r/w user,p) */
  1051.      std
  1052.  1:    stosl            /* fill the page backwards - more efficient :-) */
  1053.      subl $0x1000,%eax
  1054.      jge 1b
  1055.      cld
  1056. -    movl $_swapper_pg_dir,%eax
  1057. +    movl $ SYMBOL_NAME(swapper_pg_dir),%eax
  1058.      movl %eax,%cr3            /* cr3 - page directory start */
  1059.      movl %cr0,%eax
  1060.      orl $0x80000000,%eax
  1061. @@ -268,22 +265,22 @@
  1062.   * by 2-3k.  This would be a good thing to do at some point.....
  1063.   */
  1064.  .org 0x1000
  1065. -_swapper_pg_dir:
  1066. +ENTRY(swapper_pg_dir)
  1067.  /*
  1068.   * The page tables are initialized to only 4MB here - the final page
  1069.   * tables are set up later depending on memory size.
  1070.   */
  1071.  .org 0x2000
  1072. -_pg0:
  1073. +ENTRY(pg0)
  1074.  
  1075.  .org 0x3000
  1076. -_empty_bad_page:
  1077. +ENTRY(empty_bad_page)
  1078.  
  1079.  .org 0x4000
  1080. -_empty_bad_page_table:
  1081. +ENTRY(empty_bad_page_table)
  1082.  
  1083.  .org 0x5000
  1084. -_empty_zero_page:
  1085. +ENTRY(empty_zero_page)
  1086.  
  1087.  .org 0x6000
  1088.  /*
  1089. @@ -292,17 +289,17 @@
  1090.   * sector read/write can mess it up. It can contain one full cylinder (sic) of
  1091.   * data (36*2*512 bytes).
  1092.   */
  1093. -_floppy_track_buffer:
  1094. +ENTRY(floppy_track_buffer)
  1095.      .fill 512*2*MAX_BUFFER_SECTORS,1,0
  1096.      
  1097.  stack_start:
  1098. -    .long _init_user_stack+4096
  1099. +    .long SYMBOL_NAME(init_user_stack)+4096
  1100.      .long KERNEL_DS
  1101.  
  1102.  /* This is the default interrupt "handler" :-) */
  1103.  int_msg:
  1104.      .asciz "Unknown interrupt\n"
  1105. -.align 2
  1106. +    ALIGN
  1107.  ignore_int:
  1108.      cld
  1109.      pushl %eax
  1110. @@ -316,7 +313,7 @@
  1111.      mov %ax,%es
  1112.      mov %ax,%fs
  1113.      pushl $int_msg
  1114. -    call _printk
  1115. +    call SYMBOL_NAME(printk)
  1116.      popl %eax
  1117.      pop %fs
  1118.      pop %es
  1119. @@ -329,28 +326,26 @@
  1120.  /*
  1121.   * The interrupt descriptor table has room for 256 idt's
  1122.   */
  1123. -.align 4
  1124. +    ALIGN
  1125.  .word 0
  1126.  idt_descr:
  1127.      .word 256*8-1        # idt contains 256 entries
  1128. -    .long 0xc0000000+_idt
  1129. +    .long 0xc0000000+SYMBOL_NAME(idt)
  1130.  
  1131. -.align 4
  1132. -_idt:
  1133. +ENTRY(idt)
  1134.      .fill 256,8,0        # idt is uninitialized
  1135.  
  1136. -.align 4
  1137. +    ALIGN
  1138.  .word 0
  1139.  gdt_descr:
  1140.      .word (8+2*NR_TASKS)*8-1
  1141. -    .long 0xc0000000+_gdt
  1142. +    .long 0xc0000000+SYMBOL_NAME(gdt)
  1143.  
  1144.  /*
  1145.   * This gdt setup gives the kernel a 1GB address space at virtual
  1146.   * address 0xC0000000 - space enough for expansion, I hope.
  1147.   */
  1148. -.align 4
  1149. -_gdt:
  1150. +ENTRY(gdt)
  1151.      .quad 0x0000000000000000    /* NULL descriptor */
  1152.      .quad 0x0000000000000000    /* not used */
  1153.      .quad 0xc0c39a000000ffff    /* 0x10 kernel 1GB code at 0xC0000000 */
  1154. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
  1155. --- linux-1.2.13/arch/i386/kernel/process.c    Thu Aug  3 20:32:29 1995
  1156. +++ linux/arch/i386/kernel/process.c    Thu Aug  3 20:36:22 1995
  1157. @@ -194,6 +194,31 @@
  1158.  }
  1159.  
  1160.  /*
  1161. + * fill in the fpu structure for a core dump..
  1162. + */
  1163. +int dump_fpu (struct user_i387_struct* fpu)
  1164. +{
  1165. +    int fpvalid;
  1166. +
  1167. +/* Flag indicating the math stuff is valid. We don't support this for the
  1168. +   soft-float routines yet */
  1169. +    if (hard_math) {
  1170. +        if ((fpvalid = current->used_math) != 0) {
  1171. +            if (last_task_used_math == current)
  1172. +                __asm__("clts ; fnsave %0": :"m" (*fpu));
  1173. +            else
  1174. +                memcpy(fpu,¤t->tss.i387.hard,sizeof(*fpu));
  1175. +        }
  1176. +    } else {
  1177. +        /* we should dump the emulator state here, but we need to
  1178. +           convert it into standard 387 format first.. */
  1179. +        fpvalid = 0;
  1180. +    }
  1181. +
  1182. +    return fpvalid;
  1183. +}
  1184. +
  1185. +/*
  1186.   * fill in the user structure for a core dump..
  1187.   */
  1188.  void dump_thread(struct pt_regs * regs, struct user * dump)
  1189. @@ -216,20 +241,7 @@
  1190.  
  1191.      dump->regs = *regs;
  1192.  
  1193. -/* Flag indicating the math stuff is valid. We don't support this for the
  1194. -   soft-float routines yet */
  1195. -    if (hard_math) {
  1196. -        if ((dump->u_fpvalid = current->used_math) != 0) {
  1197. -            if (last_task_used_math == current)
  1198. -                __asm__("clts ; fnsave %0": :"m" (dump->i387));
  1199. -            else
  1200. -                memcpy(&dump->i387,¤t->tss.i387.hard,sizeof(dump->i387));
  1201. -        }
  1202. -    } else {
  1203. -        /* we should dump the emulator state here, but we need to
  1204. -           convert it into standard 387 format first.. */
  1205. -        dump->u_fpvalid = 0;
  1206. -    }
  1207. +    dump->u_fpvalid = dump_fpu (&dump->i387);
  1208.  }
  1209.  
  1210.  asmlinkage int sys_fork(struct pt_regs regs)
  1211. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
  1212. --- linux-1.2.13/arch/i386/kernel/setup.c    Thu Feb 23 05:31:58 1995
  1213. +++ linux/arch/i386/kernel/setup.c    Thu Aug  3 20:36:22 1995
  1214. @@ -55,7 +55,7 @@
  1215.  unsigned char aux_device_present;
  1216.  extern int ramdisk_size;
  1217.  extern int root_mountflags;
  1218. -extern int etext, edata, end;
  1219. +extern int _etext, _edata, _end;
  1220.  
  1221.  extern char empty_zero_page[PAGE_SIZE];
  1222.  
  1223. @@ -95,11 +95,11 @@
  1224.  #endif
  1225.      if (MOUNT_ROOT_RDONLY)
  1226.          root_mountflags |= MS_RDONLY;
  1227. -    memory_start = (unsigned long) &end;
  1228. +    memory_start = (unsigned long) &_end;
  1229.      init_task.mm->start_code = TASK_SIZE;
  1230. -    init_task.mm->end_code = TASK_SIZE + (unsigned long) &etext;
  1231. -    init_task.mm->end_data = TASK_SIZE + (unsigned long) &edata;
  1232. -    init_task.mm->brk = TASK_SIZE + (unsigned long) &end;
  1233. +    init_task.mm->end_code = TASK_SIZE + (unsigned long) &_etext;
  1234. +    init_task.mm->end_data = TASK_SIZE + (unsigned long) &_edata;
  1235. +    init_task.mm->brk = TASK_SIZE + (unsigned long) &_end;
  1236.  
  1237.      for (;;) {
  1238.          if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
  1239. diff -u --recursive --new-file linux-1.2.13/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
  1240. --- linux-1.2.13/arch/i386/kernel/traps.c    Wed Feb  8 05:54:00 1995
  1241. +++ linux/arch/i386/kernel/traps.c    Thu Aug  3 20:36:22 1995
  1242. @@ -99,7 +99,7 @@
  1243.      unsigned long esp;
  1244.      unsigned short ss;
  1245.      unsigned long *stack, addr, module_start, module_end;
  1246. -    extern char start_kernel, etext;
  1247. +    extern char start_kernel, _etext;
  1248.  
  1249.      esp = (unsigned long) ®s->esp;
  1250.      ss = KERNEL_DS;
  1251. @@ -147,7 +147,7 @@
  1252.           * out the call path that was taken.
  1253.           */
  1254.          if (((addr >= (unsigned long) &start_kernel) &&
  1255. -             (addr <= (unsigned long) &etext)) ||
  1256. +             (addr <= (unsigned long) &_etext)) ||
  1257.              ((addr >= module_start) && (addr <= module_end))) {
  1258.              if (i && ((i % 8) == 0))
  1259.                  printk("\n       ");
  1260. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/div_Xsig.S linux/arch/i386/math-emu/div_Xsig.S
  1261. --- linux-1.2.13/arch/i386/math-emu/div_Xsig.S    Mon Aug  1 00:19:13 1994
  1262. +++ linux/arch/i386/math-emu/div_Xsig.S    Thu Aug  3 20:36:22 1995
  1263. @@ -74,11 +74,7 @@
  1264.  
  1265.  
  1266.  .text
  1267. -    .align 2,144
  1268. -
  1269. -.globl _div_Xsig
  1270. -
  1271. -_div_Xsig:
  1272. +ENTRY(div_Xsig)
  1273.      pushl    %ebp
  1274.      movl    %esp,%ebp
  1275.  #ifndef NON_REENTRANT_FPU
  1276. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/div_small.S linux/arch/i386/math-emu/div_small.S
  1277. --- linux-1.2.13/arch/i386/math-emu/div_small.S    Wed Dec  1 06:44:16 1993
  1278. +++ linux/arch/i386/math-emu/div_small.S    Thu Aug  3 20:36:22 1995
  1279. @@ -17,11 +17,7 @@
  1280.  #include "fpu_asm.h"
  1281.  
  1282.  .text
  1283. -    .align 2,144
  1284. -
  1285. -.globl _div_small
  1286. -
  1287. -_div_small:
  1288. +ENTRY(div_small)
  1289.      pushl    %ebp
  1290.      movl    %esp,%ebp
  1291.  
  1292. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/fpu_asm.h linux/arch/i386/math-emu/fpu_asm.h
  1293. --- linux-1.2.13/arch/i386/math-emu/fpu_asm.h    Wed Dec  1 06:44:16 1993
  1294. +++ linux/arch/i386/math-emu/fpu_asm.h    Thu Aug  3 20:36:22 1995
  1295. @@ -9,9 +9,10 @@
  1296.  #ifndef _FPU_ASM_H_
  1297.  #define _FPU_ASM_H_
  1298.  
  1299. +#include <linux/linkage.h>
  1300.  #include "fpu_emu.h"
  1301.  
  1302. -#define    EXCEPTION    _exception
  1303. +#define    EXCEPTION    SYMBOL_NAME(exception)
  1304.  
  1305.  
  1306.  #define PARAM1    8(%ebp)
  1307. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/mul_Xsig.S linux/arch/i386/math-emu/mul_Xsig.S
  1308. --- linux-1.2.13/arch/i386/math-emu/mul_Xsig.S    Mon Aug  1 00:19:13 1994
  1309. +++ linux/arch/i386/math-emu/mul_Xsig.S    Thu Aug  3 20:36:23 1995
  1310. @@ -24,9 +24,7 @@
  1311.  #include "fpu_asm.h"
  1312.  
  1313.  .text
  1314. -    .align 2,144
  1315. -.globl _mul32_Xsig
  1316. -_mul32_Xsig:
  1317. +ENTRY(mul32_Xsig)
  1318.      pushl %ebp
  1319.      movl %esp,%ebp
  1320.      subl $16,%esp
  1321. @@ -66,9 +64,7 @@
  1322.      ret
  1323.  
  1324.  
  1325. -    .align 2,144
  1326. -.globl _mul64_Xsig
  1327. -_mul64_Xsig:
  1328. +ENTRY(mul64_Xsig)
  1329.      pushl %ebp
  1330.      movl %esp,%ebp
  1331.      subl $16,%esp
  1332. @@ -121,9 +117,7 @@
  1333.  
  1334.  
  1335.  
  1336. -    .align 2,144
  1337. -.globl _mul_Xsig_Xsig
  1338. -_mul_Xsig_Xsig:
  1339. +ENTRY(mul_Xsig_Xsig)
  1340.      pushl %ebp
  1341.      movl %esp,%ebp
  1342.      subl $16,%esp
  1343. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/polynom_Xsig.S linux/arch/i386/math-emu/polynom_Xsig.S
  1344. --- linux-1.2.13/arch/i386/math-emu/polynom_Xsig.S    Mon Aug  1 00:19:15 1994
  1345. +++ linux/arch/i386/math-emu/polynom_Xsig.S    Thu Aug  3 20:36:23 1995
  1346. @@ -36,9 +36,7 @@
  1347.  #define OVERFLOWED      -16(%ebp)    /* addition overflow flag */
  1348.  
  1349.  .text
  1350. -    .align 2,144
  1351. -.globl _polynomial_Xsig
  1352. -_polynomial_Xsig:
  1353. +ENTRY(polynomial_Xsig)
  1354.      pushl    %ebp
  1355.      movl    %esp,%ebp
  1356.      subl    $32,%esp
  1357. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_div.S linux/arch/i386/math-emu/reg_div.S
  1358. --- linux-1.2.13/arch/i386/math-emu/reg_div.S    Thu Jun  2 02:28:27 1994
  1359. +++ linux/arch/i386/math-emu/reg_div.S    Thu Aug  3 20:36:23 1995
  1360. @@ -19,10 +19,7 @@
  1361.  
  1362.  
  1363.  .text
  1364. -    .align 2
  1365. -
  1366. -.globl    _reg_div
  1367. -_reg_div:
  1368. +ENTRY(reg_div)
  1369.      pushl    %ebp
  1370.      movl    %esp,%ebp
  1371.  #ifndef NON_REENTRANT_FPU
  1372. @@ -47,7 +44,7 @@
  1373.      cmpl    EXP_UNDER,EXP(%esi)
  1374.      jg    xL_arg1_not_denormal
  1375.  
  1376. -    call    _denormal_operand
  1377. +    call    SYMBOL_NAME(denormal_operand)
  1378.      orl    %eax,%eax
  1379.      jnz    fpu_Arith_exit
  1380.  
  1381. @@ -55,7 +52,7 @@
  1382.      cmpl    EXP_UNDER,EXP(%ebx)
  1383.      jg    xL_arg2_not_denormal
  1384.  
  1385. -    call    _denormal_operand
  1386. +    call    SYMBOL_NAME(denormal_operand)
  1387.      orl    %eax,%eax
  1388.      jnz    fpu_Arith_exit
  1389.  
  1390. @@ -75,7 +72,7 @@
  1391.      addl    EXP_BIAS,%edx
  1392.      movl    %edx,EXP(%edi)
  1393.  
  1394. -    jmp    _divide_kernel
  1395. +    jmp    SYMBOL_NAME(divide_kernel)
  1396.  
  1397.  
  1398.  /*-----------------------------------------------------------------------*/
  1399. @@ -92,14 +89,14 @@
  1400.      pushl    %edi            /* Destination */
  1401.      pushl    %esi
  1402.      pushl    %ebx            /* Ordering is important here */
  1403. -    call    _real_2op_NaN
  1404. +    call    SYMBOL_NAME(real_2op_NaN)
  1405.      jmp    LDiv_exit
  1406.  
  1407.  /* Invalid operations */
  1408.  L_zero_zero:
  1409.  L_inf_inf:
  1410.      pushl    %edi            /* Destination */
  1411. -    call    _arith_invalid        /* 0/0 or Infinity/Infinity */
  1412. +    call    SYMBOL_NAME(arith_invalid) /* 0/0 or Infinity/Infinity */
  1413.      jmp    LDiv_exit
  1414.  
  1415.  L_no_NaN_arg:
  1416. @@ -126,7 +123,7 @@
  1417.      cmpl    EXP_UNDER,EXP(%ebx)
  1418.      jg    L_copy_arg1        /* Answer is Inf */
  1419.  
  1420. -    call    _denormal_operand
  1421. +    call    SYMBOL_NAME(denormal_operand)
  1422.      orl    %eax,%eax
  1423.      jnz    fpu_Arith_exit
  1424.  #endif DENORM_OPERAND
  1425. @@ -151,7 +148,7 @@
  1426.      movb    SIGN(%esi),%al
  1427.      xorb    SIGN(%ebx),%al
  1428.      pushl    %eax            /* lower 8 bits have the sign */
  1429. -    call    _divide_by_zero
  1430. +    call    SYMBOL_NAME(divide_by_zero)
  1431.      jmp    LDiv_exit
  1432.  
  1433.  L_arg2_not_zero:
  1434. @@ -165,7 +162,7 @@
  1435.      cmpl    EXP_UNDER,EXP(%esi)
  1436.      jg    L_return_zero        /* Answer is zero */
  1437.  
  1438. -    call    _denormal_operand
  1439. +    call    SYMBOL_NAME(denormal_operand)
  1440.      orl    %eax,%eax
  1441.      jnz    fpu_Arith_exit
  1442.  #endif DENORM_OPERAND
  1443. @@ -185,7 +182,7 @@
  1444.      cmpl    EXP_UNDER,EXP(%ebx)
  1445.      jg    L_copy_arg1        /* Answer is zero */
  1446.  
  1447. -    call    _denormal_operand
  1448. +    call    SYMBOL_NAME(denormal_operand)
  1449.      orl    %eax,%eax
  1450.      jnz    fpu_Arith_exit
  1451.  #endif DENORM_OPERAND
  1452. @@ -241,11 +238,11 @@
  1453.      call    EXCEPTION
  1454.  
  1455.      /* Generate a NaN for unknown tags */
  1456. -    movl    _CONST_QNaN,%eax
  1457. +    movl    SYMBOL_NAME(CONST_QNaN),%eax
  1458.      movl    %eax,(%edi)
  1459. -    movl    _CONST_QNaN+4,%eax
  1460. +    movl    SYMBOL_NAME(CONST_QNaN)+4,%eax
  1461.      movl    %eax,SIGL(%edi)
  1462. -    movl    _CONST_QNaN+8,%eax
  1463. +    movl    SYMBOL_NAME(CONST_QNaN)+8,%eax
  1464.      movl    %eax,SIGH(%edi)
  1465.      jmp    LDiv_exit        /* %eax is nz */
  1466.  #endif PARANOID
  1467. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_norm.S linux/arch/i386/math-emu/reg_norm.S
  1468. --- linux-1.2.13/arch/i386/math-emu/reg_norm.S    Tue Jan 11 03:10:49 1994
  1469. +++ linux/arch/i386/math-emu/reg_norm.S    Thu Aug  3 20:36:23 1995
  1470. @@ -18,11 +18,7 @@
  1471.  
  1472.  
  1473.  .text
  1474. -
  1475. -    .align 2,144
  1476. -.globl _normalize
  1477. -
  1478. -_normalize:
  1479. +ENTRY(normalize)
  1480.      pushl    %ebp
  1481.      movl    %esp,%ebp
  1482.      pushl    %ebx
  1483. @@ -34,7 +30,7 @@
  1484.      je    L_ok
  1485.  
  1486.      pushl    $0x220
  1487. -    call    _exception
  1488. +    call    SYMBOL_NAME(exception)
  1489.      addl    $4,%esp
  1490.  
  1491.  L_ok:
  1492. @@ -86,23 +82,20 @@
  1493.  
  1494.  L_underflow:
  1495.      push    %ebx
  1496. -    call    _arith_underflow
  1497. +    call    SYMBOL_NAME(arith_underflow)
  1498.      pop    %ebx
  1499.      jmp    L_exit
  1500.  
  1501.  L_overflow:
  1502.      push    %ebx
  1503. -    call    _arith_overflow
  1504. +    call    SYMBOL_NAME(arith_overflow)
  1505.      pop    %ebx
  1506.      jmp    L_exit
  1507.  
  1508.  
  1509.  
  1510.  /* Normalise without reporting underflow or overflow */
  1511. -    .align 2,144
  1512. -.globl _normalize_nuo
  1513. -
  1514. -_normalize_nuo:
  1515. +ENTRY(normalize_nuo)
  1516.      pushl    %ebp
  1517.      movl    %esp,%ebp
  1518.      pushl    %ebx
  1519. @@ -114,7 +107,7 @@
  1520.      je    L_ok_nuo
  1521.  
  1522.      pushl    $0x221
  1523. -    call    _exception
  1524. +    call    SYMBOL_NAME(exception)
  1525.      addl    $4,%esp
  1526.  
  1527.  L_ok_nuo:
  1528. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_round.S linux/arch/i386/math-emu/reg_round.S
  1529. --- linux-1.2.13/arch/i386/math-emu/reg_round.S    Fri Aug 19 06:06:50 1994
  1530. +++ linux/arch/i386/math-emu/reg_round.S    Thu Aug  3 20:36:23 1995
  1531. @@ -101,14 +101,12 @@
  1532.  
  1533.  
  1534.  .text
  1535. -    .align 2,144
  1536.  .globl fpu_reg_round
  1537.  .globl fpu_reg_round_sqrt
  1538.  .globl fpu_Arith_exit
  1539. -.globl _round_reg
  1540.  
  1541.  /* Entry point when called from C */
  1542. -_round_reg:
  1543. +ENTRY(round_reg)
  1544.      pushl    %ebp
  1545.      movl    %esp,%ebp
  1546.      pushl    %esi
  1547. @@ -435,7 +433,7 @@
  1548.   */
  1549.  xL_precision_lost_up:
  1550.      push    %eax
  1551. -    call    _set_precision_flag_up
  1552. +    call    SYMBOL_NAME(set_precision_flag_up)
  1553.      popl    %eax
  1554.      jmp    xL_no_precision_loss
  1555.  
  1556. @@ -445,7 +443,7 @@
  1557.   */
  1558.  xL_precision_lost_down:
  1559.      push    %eax
  1560. -    call    _set_precision_flag_down
  1561. +    call    SYMBOL_NAME(set_precision_flag_down)
  1562.      popl    %eax
  1563.      jmp    xL_no_precision_loss
  1564.  
  1565. @@ -598,7 +596,7 @@
  1566.      /* There must be a masked underflow */
  1567.      push    %eax
  1568.      pushl    EX_Underflow
  1569. -    call    _exception
  1570. +    call    SYMBOL_NAME(exception)
  1571.      popl    %eax
  1572.      popl    %eax
  1573.      jmp    xL_Normalised
  1574. @@ -610,12 +608,12 @@
  1575.   */
  1576.  L_underflow_to_zero:
  1577.      push    %eax
  1578. -    call    _set_precision_flag_down
  1579. +    call    SYMBOL_NAME(set_precision_flag_down)
  1580.      popl    %eax
  1581.  
  1582.      push    %eax
  1583.      pushl    EX_Underflow
  1584. -    call    _exception
  1585. +    call    SYMBOL_NAME(exception)
  1586.      popl    %eax
  1587.      popl    %eax
  1588.  
  1589. @@ -628,7 +626,7 @@
  1590.  /* The operations resulted in a number too large to represent. */
  1591.  L_overflow:
  1592.      push    %edi
  1593. -    call    _arith_overflow
  1594. +    call    SYMBOL_NAME(arith_overflow)
  1595.      pop    %edi
  1596.      jmp    fpu_reg_round_exit
  1597.  
  1598. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_u_add.S linux/arch/i386/math-emu/reg_u_add.S
  1599. --- linux-1.2.13/arch/i386/math-emu/reg_u_add.S    Wed Dec  1 06:44:16 1993
  1600. +++ linux/arch/i386/math-emu/reg_u_add.S    Thu Aug  3 20:36:23 1995
  1601. @@ -29,9 +29,7 @@
  1602.  #include "control_w.h"
  1603.  
  1604.  .text
  1605. -    .align 2,144
  1606. -.globl _reg_u_add
  1607. -_reg_u_add:
  1608. +ENTRY(reg_u_add)
  1609.      pushl    %ebp
  1610.      movl    %esp,%ebp
  1611.      pushl    %esi
  1612. @@ -45,7 +43,7 @@
  1613.      cmpl    EXP_UNDER,EXP(%esi)
  1614.      jg    xOp1_not_denorm
  1615.  
  1616. -    call    _denormal_operand
  1617. +    call    SYMBOL_NAME(denormal_operand)
  1618.      orl    %eax,%eax
  1619.      jnz    fpu_Arith_exit
  1620.  
  1621. @@ -53,7 +51,7 @@
  1622.      cmpl    EXP_UNDER,EXP(%edi)
  1623.      jg    xOp2_not_denorm
  1624.  
  1625. -    call    _denormal_operand
  1626. +    call    SYMBOL_NAME(denormal_operand)
  1627.      orl    %eax,%eax
  1628.      jnz    fpu_Arith_exit
  1629.  
  1630. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_u_div.S linux/arch/i386/math-emu/reg_u_div.S
  1631. --- linux-1.2.13/arch/i386/math-emu/reg_u_div.S    Thu Jun  2 02:28:28 1994
  1632. +++ linux/arch/i386/math-emu/reg_u_div.S    Thu Aug  3 20:36:23 1995
  1633. @@ -69,13 +69,7 @@
  1634.  
  1635.  
  1636.  .text
  1637. -    .align 2,144
  1638. -
  1639. -.globl _reg_u_div
  1640. -
  1641. -.globl _divide_kernel
  1642. -
  1643. -_reg_u_div:
  1644. +ENTRY(reg_u_div)
  1645.      pushl    %ebp
  1646.      movl    %esp,%ebp
  1647.  #ifndef NON_REENTRANT_FPU
  1648. @@ -95,7 +89,7 @@
  1649.      cmpl    EXP_UNDER,%eax
  1650.      jg    xOp1_not_denorm
  1651.  
  1652. -    call    _denormal_operand
  1653. +    call    SYMBOL_NAME(denormal_operand)
  1654.      orl    %eax,%eax
  1655.      jnz    fpu_Arith_exit
  1656.  
  1657. @@ -104,14 +98,14 @@
  1658.      cmpl    EXP_UNDER,%eax
  1659.      jg    xOp2_not_denorm
  1660.  
  1661. -    call    _denormal_operand
  1662. +    call    SYMBOL_NAME(denormal_operand)
  1663.      orl    %eax,%eax
  1664.      jnz    fpu_Arith_exit
  1665.  
  1666.  xOp2_not_denorm:
  1667.  #endif DENORM_OPERAND
  1668.  
  1669. -_divide_kernel:
  1670. +ENTRY(divide_kernel)
  1671.  #ifdef PARANOID
  1672.  /*    testl    $0x80000000, SIGH(%esi)    // Dividend */
  1673.  /*    je    L_bugged */
  1674. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_u_mul.S linux/arch/i386/math-emu/reg_u_mul.S
  1675. --- linux-1.2.13/arch/i386/math-emu/reg_u_mul.S    Thu Jun  2 02:28:28 1994
  1676. +++ linux/arch/i386/math-emu/reg_u_mul.S    Thu Aug  3 20:36:23 1995
  1677. @@ -44,10 +44,7 @@
  1678.  
  1679.  
  1680.  .text
  1681. -    .align 2,144
  1682. -
  1683. -.globl _reg_u_mul
  1684. -_reg_u_mul:
  1685. +ENTRY(reg_u_mul)
  1686.      pushl    %ebp
  1687.      movl    %esp,%ebp
  1688.  #ifndef NON_REENTRANT_FPU
  1689. @@ -73,7 +70,7 @@
  1690.      cmpl    EXP_UNDER,%eax
  1691.      jg    xOp1_not_denorm
  1692.  
  1693. -    call    _denormal_operand
  1694. +    call    SYMBOL_NAME(denormal_operand)
  1695.      orl    %eax,%eax
  1696.      jnz    fpu_Arith_exit
  1697.  
  1698. @@ -82,7 +79,7 @@
  1699.      cmpl    EXP_UNDER,%eax
  1700.      jg    xOp2_not_denorm
  1701.  
  1702. -    call    _denormal_operand
  1703. +    call    SYMBOL_NAME(denormal_operand)
  1704.      orl    %eax,%eax
  1705.      jnz    fpu_Arith_exit
  1706.  
  1707. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/reg_u_sub.S linux/arch/i386/math-emu/reg_u_sub.S
  1708. --- linux-1.2.13/arch/i386/math-emu/reg_u_sub.S    Wed Dec  1 06:44:16 1993
  1709. +++ linux/arch/i386/math-emu/reg_u_sub.S    Thu Aug  3 20:36:23 1995
  1710. @@ -30,9 +30,7 @@
  1711.  #include "control_w.h"
  1712.  
  1713.  .text
  1714. -    .align 2,144
  1715. -.globl _reg_u_sub
  1716. -_reg_u_sub:
  1717. +ENTRY(reg_u_sub)
  1718.      pushl    %ebp
  1719.      movl    %esp,%ebp
  1720.      pushl    %esi
  1721. @@ -46,7 +44,7 @@
  1722.      cmpl    EXP_UNDER,EXP(%esi)
  1723.      jg    xOp1_not_denorm
  1724.  
  1725. -    call    _denormal_operand
  1726. +    call    SYMBOL_NAME(denormal_operand)
  1727.      orl    %eax,%eax
  1728.      jnz    fpu_Arith_exit
  1729.  
  1730. @@ -54,7 +52,7 @@
  1731.      cmpl    EXP_UNDER,EXP(%edi)
  1732.      jg    xOp2_not_denorm
  1733.  
  1734. -    call    _denormal_operand
  1735. +    call    SYMBOL_NAME(denormal_operand)
  1736.      orl    %eax,%eax
  1737.      jnz    fpu_Arith_exit
  1738.  
  1739. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/round_Xsig.S linux/arch/i386/math-emu/round_Xsig.S
  1740. --- linux-1.2.13/arch/i386/math-emu/round_Xsig.S    Mon Aug  1 00:19:15 1994
  1741. +++ linux/arch/i386/math-emu/round_Xsig.S    Thu Aug  3 20:36:23 1995
  1742. @@ -22,11 +22,7 @@
  1743.  
  1744.  
  1745.  .text
  1746. -
  1747. -    .align 2,144
  1748. -.globl _round_Xsig
  1749. -
  1750. -_round_Xsig:
  1751. +ENTRY(round_Xsig)
  1752.      pushl    %ebp
  1753.      movl    %esp,%ebp
  1754.      pushl    %ebx        /* Reserve some space */
  1755. @@ -86,10 +82,7 @@
  1756.  
  1757.  
  1758.  
  1759. -    .align 2,144
  1760. -.globl _norm_Xsig
  1761. -
  1762. -_norm_Xsig:
  1763. +ENTRY(norm_Xsig)
  1764.      pushl    %ebp
  1765.      movl    %esp,%ebp
  1766.      pushl    %ebx        /* Reserve some space */
  1767. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/shr_Xsig.S linux/arch/i386/math-emu/shr_Xsig.S
  1768. --- linux-1.2.13/arch/i386/math-emu/shr_Xsig.S    Mon Aug  1 00:19:16 1994
  1769. +++ linux/arch/i386/math-emu/shr_Xsig.S    Thu Aug  3 20:36:23 1995
  1770. @@ -21,10 +21,7 @@
  1771.  #include "fpu_asm.h"
  1772.  
  1773.  .text
  1774. -    .align 2,144
  1775. -
  1776. -    .globl    _shr_Xsig
  1777. -_shr_Xsig:
  1778. +ENTRY(shr_Xsig)
  1779.      push    %ebp
  1780.      movl    %esp,%ebp
  1781.      pushl    %esi
  1782. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/wm_shrx.S linux/arch/i386/math-emu/wm_shrx.S
  1783. --- linux-1.2.13/arch/i386/math-emu/wm_shrx.S    Wed Dec  1 06:44:16 1993
  1784. +++ linux/arch/i386/math-emu/wm_shrx.S    Thu Aug  3 20:36:23 1995
  1785. @@ -17,8 +17,6 @@
  1786.  #include "fpu_asm.h"
  1787.  
  1788.  .text
  1789. -    .align 2,144
  1790. -
  1791.  /*---------------------------------------------------------------------------+
  1792.   |   unsigned shrx(void *arg1, unsigned arg2)                                |
  1793.   |                                                                           |
  1794. @@ -33,9 +31,7 @@
  1795.   |   Results returned in the 64 bit arg and eax.                             |
  1796.   +---------------------------------------------------------------------------*/
  1797.  
  1798. -    .globl    _shrx
  1799. -
  1800. -_shrx:
  1801. +ENTRY(shrx)
  1802.      push    %ebp
  1803.      movl    %esp,%ebp
  1804.      pushl    %esi
  1805. @@ -113,8 +109,7 @@
  1806.   |   part which has been shifted out of the arg.                             |
  1807.   |   Results returned in the 64 bit arg and eax.                             |
  1808.   +---------------------------------------------------------------------------*/
  1809. -    .globl    _shrxs
  1810. -_shrxs:
  1811. +ENTRY(shrxs)
  1812.      push    %ebp
  1813.      movl    %esp,%ebp
  1814.      pushl    %esi
  1815. diff -u --recursive --new-file linux-1.2.13/arch/i386/math-emu/wm_sqrt.S linux/arch/i386/math-emu/wm_sqrt.S
  1816. --- linux-1.2.13/arch/i386/math-emu/wm_sqrt.S    Thu Jun  2 02:28:28 1994
  1817. +++ linux/arch/i386/math-emu/wm_sqrt.S    Thu Aug  3 20:36:23 1995
  1818. @@ -74,10 +74,7 @@
  1819.  
  1820.  
  1821.  .text
  1822. -    .align 2,144
  1823. -
  1824. -.globl _wm_sqrt
  1825. -_wm_sqrt:
  1826. +ENTRY(wm_sqrt)
  1827.      pushl    %ebp
  1828.      movl    %esp,%ebp
  1829.  #ifndef NON_REENTRANT_FPU
  1830. diff -u --recursive --new-file linux-1.2.13/arch/i386/mm/init.c linux/arch/i386/mm/init.c
  1831. --- linux-1.2.13/arch/i386/mm/init.c    Thu Aug  3 20:32:00 1995
  1832. +++ linux/arch/i386/mm/init.c    Thu Aug  3 20:36:23 1995
  1833. @@ -161,7 +161,7 @@
  1834.      int reservedpages = 0;
  1835.      int datapages = 0;
  1836.      unsigned long tmp;
  1837. -    extern int etext;
  1838. +    extern int _etext;
  1839.  
  1840.      end_mem &= PAGE_MASK;
  1841.      high_memory = end_mem;
  1842. @@ -194,7 +194,7 @@
  1843.          if (mem_map[MAP_NR(tmp)]) {
  1844.              if (tmp >= 0xA0000 && tmp < 0x100000)
  1845.                  reservedpages++;
  1846. -            else if (tmp < (unsigned long) &etext)
  1847. +            else if (tmp < (unsigned long) &_etext)
  1848.                  codepages++;
  1849.              else
  1850.                  datapages++;
  1851. diff -u --recursive --new-file linux-1.2.13/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
  1852. --- linux-1.2.13/drivers/scsi/53c7,8xx.c    Thu Aug  3 20:32:36 1995
  1853. +++ linux/drivers/scsi/53c7,8xx.c    Thu Aug  3 20:36:32 1995
  1854. @@ -2266,13 +2266,19 @@
  1855.       * and SCSI recommended .5s selection timeout.
  1856.       */
  1857.  
  1858. +    /*
  1859. +     * The new gcc won't recognize preprocessing directives
  1860. +     * within macro args.
  1861. +     */
  1862. +#if 0
  1863.      NCR53c7x0_write8(STIME0_REG_800, 
  1864.          ((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK) 
  1865.  /* Disable HTH interrupt */
  1866. -#if 0
  1867. -    | ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK)
  1868. +    | ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK));
  1869. +#else
  1870. +    NCR53c7x0_write8(STIME0_REG_800, 
  1871. +        ((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK));
  1872.  #endif
  1873. -    );
  1874.  
  1875.  
  1876.  
  1877. diff -u --recursive --new-file linux-1.2.13/drivers/scsi/seagate.c linux/drivers/scsi/seagate.c
  1878. --- linux-1.2.13/drivers/scsi/seagate.c    Thu Aug  3 20:32:03 1995
  1879. +++ linux/drivers/scsi/seagate.c    Thu Aug  3 20:36:51 1995
  1880. @@ -1105,8 +1105,8 @@
  1881.  
  1882.      cld
  1883.  
  1884. -    movl _st0x_cr_sr, %%ebx
  1885. -    movl _st0x_dr, %%edi
  1886. +    movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%ebx
  1887. +    movl " SYMBOL_NAME_STR(st0x_dr) ", %%edi
  1888.      
  1889.  1:    movb (%%ebx), %%al\n"
  1890.  /*
  1891. @@ -1241,8 +1241,8 @@
  1892.      jz 2f
  1893.  
  1894.      cld
  1895. -    movl _st0x_cr_sr, %%esi
  1896. -    movl _st0x_dr, %%ebx
  1897. +    movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%esi
  1898. +    movl " SYMBOL_NAME_STR(st0x_dr) ", %%ebx
  1899.  
  1900.  1:    movb (%%esi), %%al\n"
  1901.  /*
  1902. diff -u --recursive --new-file linux-1.2.13/fs/binfmt_elf.c linux/fs/binfmt_elf.c
  1903. --- linux-1.2.13/fs/binfmt_elf.c    Thu Aug  3 20:32:35 1995
  1904. +++ linux/fs/binfmt_elf.c    Thu Aug  3 20:36:55 1995
  1905. @@ -18,6 +18,7 @@
  1906.  #endif
  1907.  
  1908.  #include <linux/fs.h>
  1909. +#include <linux/stat.h>
  1910.  #include <linux/sched.h>
  1911.  #include <linux/mm.h>
  1912.  #include <linux/mman.h>
  1913. @@ -31,6 +32,7 @@
  1914.  #include <linux/malloc.h>
  1915.  #include <linux/shm.h>
  1916.  #include <linux/personality.h>
  1917. +#include <linux/elfcore.h>
  1918.  
  1919.  #include <asm/segment.h>
  1920.  #include <asm/pgtable.h>
  1921. @@ -48,12 +50,14 @@
  1922.  
  1923.  static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
  1924.  static int load_elf_library(int fd);
  1925. +static int elf_core_dump(long signr, struct pt_regs * regs);
  1926. +extern int dump_fpu (elf_fpregset_t *);
  1927.  
  1928.  struct linux_binfmt elf_format = {
  1929.  #ifndef MODULE
  1930. -    NULL, NULL, load_elf_binary, load_elf_library, NULL
  1931. +    NULL, NULL, load_elf_binary, load_elf_library, elf_core_dump
  1932.  #else
  1933. -    NULL, &mod_use_count_, load_elf_binary, load_elf_library, NULL
  1934. +    NULL, &mod_use_count_, load_elf_binary, load_elf_library, elf_core_dump
  1935.  #endif
  1936.  };
  1937.  
  1938. @@ -741,6 +745,411 @@
  1939.      return 0;
  1940.  }
  1941.  
  1942. +/*
  1943. + * ELF core dumper
  1944. + *
  1945. + * Modelled on fs/exec.c:aout_core_dump()
  1946. + * Jeremy Fitzhardinge <jeremy@sw.oz.au>
  1947. + */
  1948. +/*
  1949. + * These are the only things you should do on a core-file: use only these
  1950. + * functions to write out all the necessary info.
  1951. + */
  1952. +static int dump_write(struct file *file, void *addr, int nr)
  1953. +{
  1954. +    return file->f_op->write(file->f_inode, file, addr, nr) == nr;
  1955. +}
  1956. +
  1957. +static int dump_seek(struct file *file, off_t off)
  1958. +{
  1959. +    if (file->f_op->lseek) {
  1960. +        if (file->f_op->lseek(file->f_inode, file, off, 0) != off)
  1961. +            return 0;
  1962. +    } else
  1963. +        file->f_pos = off;
  1964. +    return 1;
  1965. +}
  1966. +
  1967. +/*
  1968. + * Decide whether a segment is worth dumping; default is yes to be
  1969. + * sure (missing info is worse than too much; etc).
  1970. + * Personally I'd include everything, and use the coredump limit...
  1971. + *
  1972. + * I think we should skip something. But I am not sure how. H.J.
  1973. + */
  1974. +static inline int maydump(struct vm_area_struct *vma)
  1975. +{
  1976. +#if 1
  1977. +    if (vma->vm_flags & (VM_WRITE|VM_GROWSUP|VM_GROWSDOWN))
  1978. +        return 1;
  1979. +    if (vma->vm_flags & (VM_READ|VM_EXEC|VM_EXECUTABLE|VM_SHARED))
  1980. +        return 0;
  1981. +#endif
  1982. +    return 1;
  1983. +}
  1984. +
  1985. +#define roundup(x, y)  ((((x)+((y)-1))/(y))*(y))
  1986. +
  1987. +/* An ELF note in memory */
  1988. +struct memelfnote
  1989. +{
  1990. +    char *name;
  1991. +    int type;
  1992. +    unsigned int datasz;
  1993. +    void *data;
  1994. +};
  1995. +
  1996. +static int notesize(struct memelfnote *en)
  1997. +{
  1998. +    int sz;
  1999. +    
  2000. +    sz = sizeof(struct elf_note);
  2001. +    sz += roundup(strlen(en->name), 4);
  2002. +    sz += roundup(en->datasz, 4);
  2003. +    
  2004. +    return sz;
  2005. +}
  2006. +
  2007. +/* #define DEBUG */
  2008. +
  2009. +#ifdef DEBUG
  2010. +static void dump_regs(const char *str, elf_greg_t *r)
  2011. +{
  2012. +    int i;
  2013. +    static const char *regs[] = { "ebx", "ecx", "edx", "esi", "edi", "ebp",
  2014. +                          "eax", "ds", "es", "fs", "gs",
  2015. +                          "orig_eax", "eip", "cs",
  2016. +                          "efl", "uesp", "ss"};
  2017. +    printk("Registers: %s\n", str);
  2018. +
  2019. +    for(i = 0; i < ELF_NGREG; i++)
  2020. +    {
  2021. +        unsigned long val = r[i];
  2022. +        printk("   %-2d %-5s=%08lx %lu\n", i, regs[i], val, val);
  2023. +    }
  2024. +}
  2025. +#endif
  2026. +
  2027. +#define DUMP_WRITE(addr, nr)    \
  2028. +    do { if (!dump_write(file, (addr), (nr))) return 0; } while(0)
  2029. +#define DUMP_SEEK(off)    \
  2030. +    do { if (!dump_seek(file, (off))) return 0; } while(0)
  2031. +
  2032. +static int writenote(struct memelfnote *men, struct file *file)
  2033. +{
  2034. +    struct elf_note en;
  2035. +
  2036. +    en.n_namesz = strlen(men->name);
  2037. +    en.n_descsz = men->datasz;
  2038. +    en.n_type = men->type;
  2039. +
  2040. +    DUMP_WRITE(&en, sizeof(en));
  2041. +    DUMP_WRITE(men->name, en.n_namesz);
  2042. +    /* XXX - cast from long long to long to avoid need for libgcc.a */
  2043. +    DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));    /* XXX */
  2044. +    DUMP_WRITE(men->data, men->datasz);
  2045. +    DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));    /* XXX */
  2046. +    
  2047. +    return 1;
  2048. +}
  2049. +#undef DUMP_WRITE
  2050. +#undef DUMP_SEEK
  2051. +
  2052. +#define DUMP_WRITE(addr, nr)    \
  2053. +    if (!dump_write(&file, (addr), (nr))) \
  2054. +        goto close_coredump;
  2055. +#define DUMP_SEEK(off)    \
  2056. +    if (!dump_seek(&file, (off))) \
  2057. +        goto close_coredump;
  2058. +/*
  2059. + * Actual dumper
  2060. + *
  2061. + * This is a two-pass process; first we find the offsets of the bits,
  2062. + * and then they are actually written out.  If we run out of core limit
  2063. + * we just truncate.
  2064. + */
  2065. +static int elf_core_dump(long signr, struct pt_regs * regs)
  2066. +{
  2067. +    int has_dumped = 0;
  2068. +    struct file file;
  2069. +    struct inode *inode;
  2070. +    unsigned short fs;
  2071. +    char corefile[6+sizeof(current->comm)];
  2072. +    int segs;
  2073. +    int i;
  2074. +    size_t size;
  2075. +    struct vm_area_struct *vma;
  2076. +    struct elfhdr elf;
  2077. +    off_t offset = 0, dataoff;
  2078. +    int limit = current->rlim[RLIMIT_CORE].rlim_cur;
  2079. +    int numnote = 4;
  2080. +    struct memelfnote notes[4];
  2081. +    struct elf_prstatus prstatus;    /* NT_PRSTATUS */
  2082. +    elf_fpregset_t fpu;        /* NT_PRFPREG */
  2083. +    struct elf_prpsinfo psinfo;    /* NT_PRPSINFO */
  2084. +    
  2085. +    if (!current->dumpable || limit < PAGE_SIZE)
  2086. +        return 0;
  2087. +    current->dumpable = 0;
  2088. +
  2089. +#ifndef CONFIG_BINFMT_ELF
  2090. +    MOD_INC_USE_COUNT;
  2091. +#endif
  2092. +
  2093. +    /* Count what's needed to dump, up to the limit of coredump size */
  2094. +    segs = 0;
  2095. +    size = 0;
  2096. +    for(vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
  2097. +        int sz = vma->vm_end-vma->vm_start;
  2098. +        
  2099. +        if (!maydump(vma))
  2100. +            continue;
  2101. +
  2102. +        if (size+sz > limit)
  2103. +            break;
  2104. +        
  2105. +        segs++;
  2106. +        size += sz;
  2107. +    }
  2108. +#ifdef DEBUG
  2109. +    printk("elf_core_dump: %d segs taking %d bytes\n", segs, size);
  2110. +#endif
  2111. +
  2112. +    /* Set up header */
  2113. +    memcpy(elf.e_ident, ELFMAG, SELFMAG);
  2114. +    elf.e_ident[EI_CLASS] = ELFCLASS32;
  2115. +    elf.e_ident[EI_DATA] = ELFDATA2LSB;
  2116. +    elf.e_ident[EI_VERSION] = EV_CURRENT;
  2117. +    memset(elf.e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
  2118. +    
  2119. +    elf.e_type = ET_CORE;
  2120. +    elf.e_machine = EM_386;
  2121. +    elf.e_version = EV_CURRENT;
  2122. +    elf.e_entry = 0;
  2123. +    elf.e_phoff = sizeof(elf);
  2124. +    elf.e_shoff = 0;
  2125. +    elf.e_flags = 0;
  2126. +    elf.e_ehsize = sizeof(elf);
  2127. +    elf.e_phentsize = sizeof(struct elf_phdr);
  2128. +    elf.e_phnum = segs+1;        /* Include notes */
  2129. +    elf.e_shentsize = 0;
  2130. +    elf.e_shnum = 0;
  2131. +    elf.e_shstrndx = 0;
  2132. +    
  2133. +    fs = get_fs();
  2134. +    set_fs(KERNEL_DS);
  2135. +    memcpy(corefile,"core.",5);
  2136. +#if 0
  2137. +    memcpy(corefile+5,current->comm,sizeof(current->comm));
  2138. +#else
  2139. +    corefile[4] = '\0';
  2140. +#endif
  2141. +    if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode,NULL)) {
  2142. +        inode = NULL;
  2143. +        goto end_coredump;
  2144. +    }
  2145. +    if (!S_ISREG(inode->i_mode))
  2146. +        goto end_coredump;
  2147. +    if (!inode->i_op || !inode->i_op->default_file_ops)
  2148. +        goto end_coredump;
  2149. +    file.f_mode = 3;
  2150. +    file.f_flags = 0;
  2151. +    file.f_count = 1;
  2152. +    file.f_inode = inode;
  2153. +    file.f_pos = 0;
  2154. +    file.f_reada = 0;
  2155. +    file.f_op = inode->i_op->default_file_ops;
  2156. +    if (file.f_op->open)
  2157. +        if (file.f_op->open(inode,&file))
  2158. +            goto end_coredump;
  2159. +    if (!file.f_op->write)
  2160. +        goto close_coredump;
  2161. +    has_dumped = 1;
  2162. +
  2163. +    DUMP_WRITE(&elf, sizeof(elf));
  2164. +    offset += sizeof(elf);                /* Elf header */
  2165. +    offset += (segs+1) * sizeof(struct elf_phdr);    /* Program headers */
  2166. +
  2167. +    /*
  2168. +     * Set up the notes in similar form to SVR4 core dumps made
  2169. +     * with info from their /proc.
  2170. +     */
  2171. +    memset(&psinfo, 0, sizeof(psinfo));
  2172. +    memset(&prstatus, 0, sizeof(prstatus));
  2173. +
  2174. +    notes[0].name = "CORE";
  2175. +    notes[0].type = NT_PRSTATUS;
  2176. +    notes[0].datasz = sizeof(prstatus);
  2177. +    notes[0].data = &prstatus;
  2178. +    prstatus.pr_info.si_signo = prstatus.pr_cursig = signr;
  2179. +    prstatus.pr_sigpend = current->signal;
  2180. +    prstatus.pr_sighold = current->blocked;
  2181. +    psinfo.pr_pid = prstatus.pr_pid = current->pid;
  2182. +    psinfo.pr_ppid = prstatus.pr_ppid = current->p_pptr->pid;
  2183. +    psinfo.pr_pgrp = prstatus.pr_pgrp = current->pgrp;
  2184. +    psinfo.pr_sid = prstatus.pr_sid = current->session;
  2185. +    prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
  2186. +    prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
  2187. +    prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime);
  2188. +    prstatus.pr_stime.tv_usec = CT_TO_USECS(current->stime);
  2189. +    prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->cutime);
  2190. +    prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->cutime);
  2191. +    prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->cstime);
  2192. +    prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->cstime);
  2193. +    if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
  2194. +    {
  2195. +        printk("sizeof(elf_gregset_t) (%d) != sizeof(struct pt_regs) (%d)\n",
  2196. +            sizeof(elf_gregset_t), sizeof(struct pt_regs));
  2197. +    }
  2198. +    else
  2199. +        *(struct pt_regs *)&prstatus.pr_reg = *regs;
  2200. +    
  2201. +#ifdef DEBUG
  2202. +    dump_regs("Passed in regs", (elf_greg_t *)regs);
  2203. +    dump_regs("prstatus regs", (elf_greg_t *)&prstatus.pr_reg);
  2204. +#endif
  2205. +
  2206. +    notes[1].name = "CORE";
  2207. +    notes[1].type = NT_PRPSINFO;
  2208. +    notes[1].datasz = sizeof(psinfo);
  2209. +    notes[1].data = &psinfo;
  2210. +    psinfo.pr_state = current->state;
  2211. +    psinfo.pr_sname = (current->state < 0 || current->state > 5) ? '.' : "RSDZTD"[current->state];
  2212. +    psinfo.pr_zomb = psinfo.pr_sname == 'Z';
  2213. +    psinfo.pr_nice = current->priority-15;
  2214. +    psinfo.pr_flag = current->flags;
  2215. +    psinfo.pr_uid = current->uid;
  2216. +    psinfo.pr_gid = current->gid;
  2217. +    {
  2218. +        int i, len;
  2219. +
  2220. +        set_fs(fs);
  2221. +        
  2222. +        len = current->mm->arg_end - current->mm->arg_start;
  2223. +        len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len;
  2224. +        memcpy_fromfs(&psinfo.pr_psargs,
  2225. +                  (const char *)current->mm->arg_start, len);
  2226. +        for(i = 0; i < len; i++)
  2227. +            if (psinfo.pr_psargs[i] == 0)
  2228. +                psinfo.pr_psargs[i] = ' ';
  2229. +        psinfo.pr_psargs[len] = 0;
  2230. +
  2231. +        set_fs(KERNEL_DS);
  2232. +    }
  2233. +    strncpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
  2234. +
  2235. +    notes[2].name = "CORE";
  2236. +    notes[2].type = NT_TASKSTRUCT;
  2237. +    notes[2].datasz = sizeof(*current);
  2238. +    notes[2].data = current;
  2239. +    
  2240. +    /* Try to dump the fpu. */
  2241. +    prstatus.pr_fpvalid = dump_fpu (&fpu);
  2242. +    if (!prstatus.pr_fpvalid)
  2243. +    {
  2244. +        numnote--;
  2245. +    }
  2246. +    else
  2247. +    {
  2248. +        notes[3].name = "CORE";
  2249. +        notes[3].type = NT_PRFPREG;
  2250. +        notes[3].datasz = sizeof(fpu);
  2251. +        notes[3].data = &fpu;
  2252. +    }
  2253. +    
  2254. +    /* Write notes phdr entry */
  2255. +    {
  2256. +        struct elf_phdr phdr;
  2257. +        int sz = 0;
  2258. +
  2259. +        for(i = 0; i < numnote; i++)
  2260. +            sz += notesize(¬es[i]);
  2261. +        
  2262. +        phdr.p_type = PT_NOTE;
  2263. +        phdr.p_offset = offset;
  2264. +        phdr.p_vaddr = 0;
  2265. +        phdr.p_paddr = 0;
  2266. +        phdr.p_filesz = sz;
  2267. +        phdr.p_memsz = 0;
  2268. +        phdr.p_flags = 0;
  2269. +        phdr.p_align = 0;
  2270. +
  2271. +        offset += phdr.p_filesz;
  2272. +        DUMP_WRITE(&phdr, sizeof(phdr));
  2273. +    }
  2274. +
  2275. +    /* Page-align dumped data */
  2276. +    dataoff = offset = roundup(offset, PAGE_SIZE);
  2277. +    
  2278. +    /* Write program headers for segments dump */
  2279. +    for(vma = current->mm->mmap, i = 0;
  2280. +        i < segs && vma != NULL; vma = vma->vm_next) {
  2281. +        struct elf_phdr phdr;
  2282. +        size_t sz;
  2283. +
  2284. +        if (!maydump(vma))
  2285. +            continue;
  2286. +        i++;
  2287. +
  2288. +        sz = vma->vm_end - vma->vm_start;
  2289. +        
  2290. +        phdr.p_type = PT_LOAD;
  2291. +        phdr.p_offset = offset;
  2292. +        phdr.p_vaddr = vma->vm_start;
  2293. +        phdr.p_paddr = 0;
  2294. +        phdr.p_filesz = sz;
  2295. +        phdr.p_memsz = sz;
  2296. +        offset += sz;
  2297. +        phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
  2298. +        if (vma->vm_flags & VM_WRITE) phdr.p_flags |= PF_W;
  2299. +        if (vma->vm_flags & VM_EXEC) phdr.p_flags |= PF_X;
  2300. +        phdr.p_align = PAGE_SIZE;
  2301. +
  2302. +        DUMP_WRITE(&phdr, sizeof(phdr));
  2303. +    }
  2304. +
  2305. +    for(i = 0; i < numnote; i++)
  2306. +        if (!writenote(¬es[i], &file))
  2307. +            goto close_coredump;
  2308. +    
  2309. +    set_fs(fs);
  2310. +
  2311. +    DUMP_SEEK(dataoff);
  2312. +    
  2313. +    for(i = 0, vma = current->mm->mmap;
  2314. +        i < segs && vma != NULL;
  2315. +        vma = vma->vm_next) {
  2316. +        unsigned long addr = vma->vm_start;
  2317. +        unsigned long len = vma->vm_end - vma->vm_start;
  2318. +        
  2319. +        if (!maydump(vma))
  2320. +            continue;
  2321. +        i++;
  2322. +#ifdef DEBUG
  2323. +        printk("elf_core_dump: writing %08lx %lx\n", addr, len);
  2324. +#endif
  2325. +        DUMP_WRITE((void *)addr, len);
  2326. +    }
  2327. +
  2328. +    if (file.f_pos != offset) {
  2329. +        /* Sanity check */
  2330. +        printk("elf_core_dump: file.f_pos (%ld) != offset (%ld)\n",
  2331. +               file.f_pos, offset);
  2332. +    }
  2333. +
  2334. + close_coredump:
  2335. +    if (file.f_op->release)
  2336. +        file.f_op->release(inode,&file);
  2337. +
  2338. + end_coredump:
  2339. +    set_fs(fs);
  2340. +    iput(inode);
  2341. +#ifndef CONFIG_BINFMT_ELF
  2342. +    MOD_DEC_USE_COUNT;
  2343. +#endif
  2344. +    return has_dumped;
  2345. +}
  2346. +
  2347.  #ifdef MODULE
  2348.  char kernel_version[] = UTS_RELEASE;
  2349.  
  2350. @@ -752,6 +1161,7 @@
  2351.      register_binfmt(&elf_format);
  2352.      return 0;
  2353.  }
  2354. +
  2355.  
  2356.  void cleanup_module( void) {
  2357.      
  2358. diff -u --recursive --new-file linux-1.2.13/include/asm-i386/irq.h linux/include/asm-i386/irq.h
  2359. --- linux-1.2.13/include/asm-i386/irq.h    Sun Nov 27 12:19:54 1994
  2360. +++ linux/include/asm-i386/irq.h    Thu Aug  3 20:36:56 1995
  2361. @@ -79,8 +79,8 @@
  2362.      "inb $0x21,%al\n\t" \
  2363.      "jmp 1f\n" \
  2364.      "1:\tjmp 1f\n" \
  2365. -    "1:\torb $" #mask ",_cache_21\n\t" \
  2366. -    "movb _cache_21,%al\n\t" \
  2367. +    "1:\torb $" #mask ","SYMBOL_NAME_STR(cache_21)"\n\t" \
  2368. +    "movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \
  2369.      "outb %al,$0x21\n\t" \
  2370.      "jmp 1f\n" \
  2371.      "1:\tjmp 1f\n" \
  2372. @@ -91,8 +91,8 @@
  2373.      "inb $0xA1,%al\n\t" \
  2374.      "jmp 1f\n" \
  2375.      "1:\tjmp 1f\n" \
  2376. -    "1:\torb $" #mask ",_cache_A1\n\t" \
  2377. -    "movb _cache_A1,%al\n\t" \
  2378. +    "1:\torb $" #mask ","SYMBOL_NAME_STR(cache_A1)"\n\t" \
  2379. +    "movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \
  2380.      "outb %al,$0xA1\n\t" \
  2381.      "jmp 1f\n" \
  2382.      "1:\tjmp 1f\n" \
  2383. @@ -106,16 +106,16 @@
  2384.      "inb $0x21,%al\n\t" \
  2385.      "jmp 1f\n" \
  2386.      "1:\tjmp 1f\n" \
  2387. -    "1:\tandb $~(" #mask "),_cache_21\n\t" \
  2388. -    "movb _cache_21,%al\n\t" \
  2389. +    "1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_21)"\n\t" \
  2390. +    "movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \
  2391.      "outb %al,$0x21\n\t"
  2392.  
  2393.  #define UNBLK_SECOND(mask) \
  2394.      "inb $0xA1,%al\n\t" \
  2395.      "jmp 1f\n" \
  2396.      "1:\tjmp 1f\n" \
  2397. -    "1:\tandb $~(" #mask "),_cache_A1\n\t" \
  2398. -    "movb _cache_A1,%al\n\t" \
  2399. +    "1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_A1)"\n\t" \
  2400. +    "movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \
  2401.      "outb %al,$0xA1\n\t"
  2402.  
  2403.  #define IRQ_NAME2(nr) nr##_interrupt(void)
  2404. @@ -128,36 +128,36 @@
  2405.  asmlinkage void FAST_IRQ_NAME(nr); \
  2406.  asmlinkage void BAD_IRQ_NAME(nr); \
  2407.  __asm__( \
  2408. -"\n.align 4\n" \
  2409. -"_IRQ" #nr "_interrupt:\n\t" \
  2410. +"\n"ALIGN_STR"\n" \
  2411. +SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
  2412.      "pushl $-"#nr"-2\n\t" \
  2413.      SAVE_ALL \
  2414.      ACK_##chip(mask) \
  2415. -    "incl _intr_count\n\t"\
  2416. +    "incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
  2417.      "sti\n\t" \
  2418.      "movl %esp,%ebx\n\t" \
  2419.      "pushl %ebx\n\t" \
  2420.      "pushl $" #nr "\n\t" \
  2421. -    "call _do_IRQ\n\t" \
  2422. +    "call "SYMBOL_NAME_STR(do_IRQ)"\n\t" \
  2423.      "addl $8,%esp\n\t" \
  2424.      "cli\n\t" \
  2425.      UNBLK_##chip(mask) \
  2426. -    "decl _intr_count\n\t" \
  2427. +    "decl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  2428.      "jmp ret_from_sys_call\n" \
  2429. -"\n.align 4\n" \
  2430. -"_fast_IRQ" #nr "_interrupt:\n\t" \
  2431. +"\n"ALIGN_STR"\n" \
  2432. +SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \
  2433.      SAVE_MOST \
  2434.      ACK_##chip(mask) \
  2435. -    "incl _intr_count\n\t" \
  2436. +    "incl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  2437.      "pushl $" #nr "\n\t" \
  2438. -    "call _do_fast_IRQ\n\t" \
  2439. +    "call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \
  2440.      "addl $4,%esp\n\t" \
  2441.      "cli\n\t" \
  2442.      UNBLK_##chip(mask) \
  2443. -    "decl _intr_count\n\t" \
  2444. +    "decl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  2445.      RESTORE_MOST \
  2446. -"\n\n.align 4\n" \
  2447. -"_bad_IRQ" #nr "_interrupt:\n\t" \
  2448. +"\n"ALIGN_STR"\n" \
  2449. +SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \
  2450.      SAVE_MOST \
  2451.      ACK_##chip(mask) \
  2452.      RESTORE_MOST);
  2453. diff -u --recursive --new-file linux-1.2.13/include/asm-i386/system.h linux/include/asm-i386/system.h
  2454. --- linux-1.2.13/include/asm-i386/system.h    Tue Feb 14 00:39:06 1995
  2455. +++ linux/include/asm-i386/system.h    Thu Aug  3 20:36:56 1995
  2456. @@ -49,10 +49,10 @@
  2457.   */
  2458.  #define switch_to(tsk) do { \
  2459.  __asm__("cli\n\t" \
  2460. -    "xchgl %%ecx,_current\n\t" \
  2461. +    "xchgl %%ecx,"SYMBOL_NAME_STR(current)"\n\t" \
  2462.      "ljmp %0\n\t" \
  2463.      "sti\n\t" \
  2464. -    "cmpl %%ecx,_last_task_used_math\n\t" \
  2465. +    "cmpl %%ecx,"SYMBOL_NAME_STR(last_task_used_math)"\n\t" \
  2466.      "jne 1f\n\t" \
  2467.      "clts\n" \
  2468.      "1:" \
  2469. diff -u --recursive --new-file linux-1.2.13/include/linux/elfcore.h linux/include/linux/elfcore.h
  2470. --- linux-1.2.13/include/linux/elfcore.h    Wed Dec 31 18:00:00 1969
  2471. +++ linux/include/linux/elfcore.h    Thu Aug  3 20:36:59 1995
  2472. @@ -0,0 +1,97 @@
  2473. +#ifndef _LINUX_ELFCORE_H
  2474. +#define _LINUX_ELFCORE_H
  2475. +
  2476. +#include <linux/types.h>
  2477. +#include <linux/signal.h>
  2478. +#include <linux/time.h>
  2479. +#include <linux/ptrace.h>
  2480. +#include <linux/user.h>
  2481. +
  2482. +struct elf_siginfo
  2483. +{
  2484. +    int    si_signo;            /* signal number */
  2485. +    int    si_code;            /* extra code */
  2486. +    int    si_errno;            /* errno */
  2487. +};
  2488. +
  2489. +typedef unsigned long elf_greg_t;
  2490. +#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  2491. +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  2492. +typedef struct
  2493. +#ifdef __i386__
  2494. +    user_i387_struct
  2495. +#else
  2496. +#error    "The FPU in this arch is not supported by ELF core dump.".
  2497. +#endif
  2498. +elf_fpregset_t;
  2499. +
  2500. +#ifndef __KERNEL__
  2501. +typedef elf_greg_t greg_t;
  2502. +typedef elf_gregset_t gregset_t;
  2503. +typedef elf_fpregset_t fpregset_t;
  2504. +#define NGREG ELF_NGREG
  2505. +#endif
  2506. +
  2507. +/*
  2508. + * Definitons to generate Intel SVR4-like core files.
  2509. + * These mostly have the same names as the SVR4 types with "elf_"
  2510. + * tacked on the front to prevent clashes with linux definitions,
  2511. + * and the typedef forms have been avoided.  This is mostly like
  2512. + * the SVR4 structure, but more Linuxy, with things that Linux does
  2513. + * not support and which gdb doesn't really use excluded.
  2514. + * Fields present but not used are marked with "XXX".
  2515. + */
  2516. +struct elf_prstatus
  2517. +{
  2518. +#if 0
  2519. +    long    pr_flags;    /* XXX Process flags */
  2520. +    short    pr_why;        /* XXX Reason for process halt */
  2521. +    short    pr_what;    /* XXX More detailed reason */
  2522. +#endif
  2523. +    struct elf_siginfo pr_info;    /* Info associated with signal */
  2524. +    short    pr_cursig;    /* Current signal */
  2525. +    sigset_t pr_sigpend;    /* Set of pending signals */
  2526. +    sigset_t pr_sighold;    /* Set of held signals */
  2527. +#if 0
  2528. +    struct sigaltstack pr_altstack;    /* Alternate stack info */
  2529. +    struct sigaction pr_action;    /* Signal action for current sig */
  2530. +#endif
  2531. +    pid_t    pr_pid;
  2532. +    pid_t    pr_ppid;
  2533. +    pid_t    pr_pgrp;
  2534. +    pid_t    pr_sid;
  2535. +    struct timeval pr_utime;    /* User time */
  2536. +    struct timeval pr_stime;    /* System time */
  2537. +    struct timeval pr_cutime;    /* Cumulative user time */
  2538. +    struct timeval pr_cstime;    /* Cumulative system time */
  2539. +#if 0
  2540. +    long    pr_instr;        /* Current instruction */
  2541. +#endif
  2542. +    elf_gregset_t pr_reg;    /* GP registers */
  2543. +    int pr_fpvalid;        /* True if math co-processor being used.  */
  2544. +};
  2545. +
  2546. +#define ELF_PRARGSZ    (80)    /* Number of chars for args */
  2547. +
  2548. +struct elf_prpsinfo
  2549. +{
  2550. +    char    pr_state;    /* numeric process state */
  2551. +    char    pr_sname;    /* char for pr_state */
  2552. +    char    pr_zomb;    /* zombie */
  2553. +    char    pr_nice;    /* nice val */
  2554. +    unsigned long pr_flag;    /* flags */
  2555. +    uid_t    pr_uid;
  2556. +    gid_t    pr_gid;
  2557. +    pid_t    pr_pid, pr_ppid, pr_pgrp, pr_sid;
  2558. +    /* Lots missing */
  2559. +    char    pr_fname[16];    /* filename of executable */
  2560. +    char    pr_psargs[ELF_PRARGSZ];    /* initial part of arg list */
  2561. +};
  2562. +
  2563. +#ifndef __KERNEL__
  2564. +typedef struct elf_prstatus prstatus_t;
  2565. +typedef struct elf_prpsinfo prpsinfo_t;
  2566. +#define PRARGSZ ELF_PRARGSZ 
  2567. +#endif
  2568. +
  2569. +#endif /* _LINUX_ELFCORE_H */
  2570. diff -u --recursive --new-file linux-1.2.13/include/linux/linkage.h linux/include/linux/linkage.h
  2571. --- linux-1.2.13/include/linux/linkage.h    Wed Dec  1 06:44:15 1993
  2572. +++ linux/include/linux/linkage.h    Thu Aug  3 20:37:01 1995
  2573. @@ -7,4 +7,46 @@
  2574.  #define asmlinkage
  2575.  #endif
  2576.  
  2577. +#if !defined(__i486__) && !defined(__i586__)
  2578. +#ifdef __ELF__
  2579. +#define ALIGN .align 4,0x90
  2580. +#define ALIGN_STR ".align 4,0x90"
  2581. +#else  /* __ELF__ */
  2582. +#define ALIGN .align 2,0x90
  2583. +#define ALIGN_STR ".align 2,0x90"
  2584. +#endif /* __ELF__ */
  2585. +#else  /* __i486__/__i586__ */
  2586. +#ifdef __ELF__
  2587. +#define ALIGN .align 16,0x90
  2588. +#define ALIGN_STR ".align 16,0x90"
  2589. +#else  /* __ELF__ */
  2590. +#define ALIGN .align 4,0x90
  2591. +#define ALIGN_STR ".align 4,0x90"
  2592. +#endif /* __ELF__ */
  2593. +#endif /* __i486__/__i586__ */
  2594. +
  2595. +#ifdef __ELF__
  2596. +#define SYMBOL_NAME_STR(X) #X
  2597. +#define SYMBOL_NAME(X) X
  2598. +#ifdef __STDC__
  2599. +#define SYMBOL_NAME_LABEL(X) X##:
  2600. +#else
  2601. +#define SYMBOL_NAME_LABEL(X) X/**/:
  2602. +#endif
  2603. +#else
  2604. +#define SYMBOL_NAME_STR(X) "_"#X
  2605. +#ifdef __STDC__
  2606. +#define SYMBOL_NAME(X) _##X
  2607. +#define SYMBOL_NAME_LABEL(X) _##X##:
  2608. +#else
  2609. +#define SYMBOL_NAME(X) _/**/X
  2610. +#define SYMBOL_NAME_LABEL(X) _/**/X/**/:
  2611. +#endif
  2612. +#endif
  2613. +
  2614. +#define ENTRY(name) \
  2615. +  .globl SYMBOL_NAME(name); \
  2616. +  ALIGN; \
  2617. +  SYMBOL_NAME_LABEL(name)
  2618. +
  2619.  #endif
  2620. diff -u --recursive --new-file linux-1.2.13/include/linux/modules/ksyms.ver linux/include/linux/modules/ksyms.ver
  2621. --- linux-1.2.13/include/linux/modules/ksyms.ver    Wed Dec 31 18:00:00 1969
  2622. +++ linux/include/linux/modules/ksyms.ver    Thu Aug  3 20:37:04 1995
  2623. @@ -0,0 +1,199 @@
  2624. +/**** This file is generated by genksyms  DO NOT EDIT! ****/
  2625. +#if defined(CONFIG_MODVERSIONS) && !defined(__GENKSYMS__)
  2626. +#ifndef _KSYMS_VER_
  2627. +#define _KSYMS_VER_
  2628. +#define rename_module_symbol    _set_ver(rename_module_symbol, b81c73c1)
  2629. +#define register_symtab    _set_ver(register_symtab, e910ea66)
  2630. +#define EISA_bus    _set_ver(EISA_bus, 7e37737c)
  2631. +#define wp_works_ok    _set_ver(wp_works_ok, f37f99e9)
  2632. +#define pcibios_present    _set_ver(pcibios_present, a67d0654)
  2633. +#define pcibios_find_class    _set_ver(pcibios_find_class, 124ec117)
  2634. +#define pcibios_find_device    _set_ver(pcibios_find_device, 3797daed)
  2635. +#define pcibios_read_config_byte    _set_ver(pcibios_read_config_byte, e0437e05)
  2636. +#define pcibios_read_config_word    _set_ver(pcibios_read_config_word, c63f677a)
  2637. +#define pcibios_read_config_dword    _set_ver(pcibios_read_config_dword, fa4d9b83)
  2638. +#define pcibios_strerror    _set_ver(pcibios_strerror, df123029)
  2639. +#define pcibios_write_config_byte    _set_ver(pcibios_write_config_byte, d86a2e59)
  2640. +#define pcibios_write_config_word    _set_ver(pcibios_write_config_word, fd8433c2)
  2641. +#define pcibios_write_config_dword    _set_ver(pcibios_write_config_dword, 8a42e2c8)
  2642. +#define verify_area    _set_ver(verify_area, 4cfda560)
  2643. +#define do_mmap    _set_ver(do_mmap, 677e7ee1)
  2644. +#define do_munmap    _set_ver(do_munmap, 6221f117)
  2645. +#define zeromap_page_range    _set_ver(zeromap_page_range, 7c395a26)
  2646. +#define unmap_page_range    _set_ver(unmap_page_range, 0110085f)
  2647. +#define insert_vm_struct    _set_ver(insert_vm_struct, 1f4e4882)
  2648. +#define merge_segments    _set_ver(merge_segments, 6854be5a)
  2649. +#define __get_free_pages    _set_ver(__get_free_pages, 5243d78b)
  2650. +#define free_pages    _set_ver(free_pages, 96448859)
  2651. +#define kmalloc    _set_ver(kmalloc, d31fb2cb)
  2652. +#define kfree_s    _set_ver(kfree_s, 1e72eb79)
  2653. +#define vmalloc    _set_ver(vmalloc, 667f3e25)
  2654. +#define vfree    _set_ver(vfree, 6df52add)
  2655. +#define getname    _set_ver(getname, 81487159)
  2656. +#define putname    _set_ver(putname, b19e8126)
  2657. +#define __iget    _set_ver(__iget, ee2b6320)
  2658. +#define iput    _set_ver(iput, 59241ced)
  2659. +#define namei    _set_ver(namei, 00478bcd)
  2660. +#define lnamei    _set_ver(lnamei, fcfddbb1)
  2661. +#define open_namei    _set_ver(open_namei, 414b2b0f)
  2662. +#define close_fp    _set_ver(close_fp, 1d4c15d8)
  2663. +#define check_disk_change    _set_ver(check_disk_change, b66ed457)
  2664. +#define invalidate_buffers    _set_ver(invalidate_buffers, c65255f1)
  2665. +#define fsync_dev    _set_ver(fsync_dev, a221190d)
  2666. +#define permission    _set_ver(permission, 0ebf7474)
  2667. +#define inode_setattr    _set_ver(inode_setattr, 0c80a3c1)
  2668. +#define inode_change_ok    _set_ver(inode_change_ok, 5d1cb326)
  2669. +#define generic_mmap    _set_ver(generic_mmap, d4ff59f3)
  2670. +#define set_blocksize    _set_ver(set_blocksize, f45fda38)
  2671. +#define getblk    _set_ver(getblk, d40228ac)
  2672. +#define bread    _set_ver(bread, c73bf0f0)
  2673. +#define breada    _set_ver(breada, eb8e858c)
  2674. +#define brelse    _set_ver(brelse, 4c27ac3d)
  2675. +#define ll_rw_block    _set_ver(ll_rw_block, f3aa4dd3)
  2676. +#define __wait_on_buffer    _set_ver(__wait_on_buffer, e8fcc968)
  2677. +#define dcache_lookup    _set_ver(dcache_lookup, 83336566)
  2678. +#define dcache_add    _set_ver(dcache_add, fe71f11e)
  2679. +#define register_chrdev    _set_ver(register_chrdev, da99513f)
  2680. +#define unregister_chrdev    _set_ver(unregister_chrdev, 61ea5ee8)
  2681. +#define register_blkdev    _set_ver(register_blkdev, 4699a621)
  2682. +#define unregister_blkdev    _set_ver(unregister_blkdev, d39bbca9)
  2683. +#define tty_register_driver    _set_ver(tty_register_driver, fcc8591c)
  2684. +#define tty_unregister_driver    _set_ver(tty_unregister_driver, c78132a8)
  2685. +#define tty_std_termios    _set_ver(tty_std_termios, cf350678)
  2686. +#define block_read    _set_ver(block_read, a7fe4f51)
  2687. +#define block_write    _set_ver(block_write, 902674c9)
  2688. +#define block_fsync    _set_ver(block_fsync, 182888d8)
  2689. +#define wait_for_request    _set_ver(wait_for_request, 9ca2932e)
  2690. +#define blksize_size    _set_ver(blksize_size, dea1eb55)
  2691. +#define hardsect_size    _set_ver(hardsect_size, ed1ee14f)
  2692. +#define blk_size    _set_ver(blk_size, f60b5398)
  2693. +#define blk_dev    _set_ver(blk_dev, dbf5fdd4)
  2694. +#define is_read_only    _set_ver(is_read_only, b0c5f83e)
  2695. +#define set_device_ro    _set_ver(set_device_ro, 8fb69e13)
  2696. +#define bmap    _set_ver(bmap, 73bb8bdd)
  2697. +#define sync_dev    _set_ver(sync_dev, 9bca536d)
  2698. +#define get_blkfops    _set_ver(get_blkfops, 83827791)
  2699. +#define register_serial    _set_ver(register_serial, 3425f38c)
  2700. +#define unregister_serial    _set_ver(unregister_serial, c013d717)
  2701. +#define tty_hangup    _set_ver(tty_hangup, e3487df0)
  2702. +#define tty_wait_until_sent    _set_ver(tty_wait_until_sent, da85d428)
  2703. +#define tty_check_change    _set_ver(tty_check_change, 705eaab0)
  2704. +#define tty_hung_up_p    _set_ver(tty_hung_up_p, f99ac1e4)
  2705. +#define register_filesystem    _set_ver(register_filesystem, 1c7110ef)
  2706. +#define unregister_filesystem    _set_ver(unregister_filesystem, 5e353af7)
  2707. +#define register_binfmt    _set_ver(register_binfmt, 66ece706)
  2708. +#define unregister_binfmt    _set_ver(unregister_binfmt, 41822618)
  2709. +#define lookup_exec_domain    _set_ver(lookup_exec_domain, 32f10d48)
  2710. +#define register_exec_domain    _set_ver(register_exec_domain, eda4711f)
  2711. +#define unregister_exec_domain    _set_ver(unregister_exec_domain, 78ea447c)
  2712. +#define request_irq    _set_ver(request_irq, 9e81629c)
  2713. +#define free_irq    _set_ver(free_irq, f487dc0c)
  2714. +#define enable_irq    _set_ver(enable_irq, 54e09f5f)
  2715. +#define disable_irq    _set_ver(disable_irq, b4449c1f)
  2716. +#define bh_active    _set_ver(bh_active, 98fb5ca1)
  2717. +#define bh_mask    _set_ver(bh_mask, 1abf3d3f)
  2718. +#define add_timer    _set_ver(add_timer, f13cb728)
  2719. +#define del_timer    _set_ver(del_timer, c7aff713)
  2720. +#define tq_timer    _set_ver(tq_timer, 46cf583e)
  2721. +#define tq_immediate    _set_ver(tq_immediate, 46cf583e)
  2722. +#define tq_scheduler    _set_ver(tq_scheduler, 46cf583e)
  2723. +#define tq_last    _set_ver(tq_last, 457cf547)
  2724. +#define timer_active    _set_ver(timer_active, 5a6747ee)
  2725. +#define timer_table    _set_ver(timer_table, 9e03b650)
  2726. +#define request_dma    _set_ver(request_dma, 2a687646)
  2727. +#define free_dma    _set_ver(free_dma, 5d4b914c)
  2728. +#define disable_hlt    _set_ver(disable_hlt, 794487ee)
  2729. +#define enable_hlt    _set_ver(enable_hlt, 9c7077bd)
  2730. +#define check_region    _set_ver(check_region, b91154fb)
  2731. +#define request_region    _set_ver(request_region, 138b0a1e)
  2732. +#define release_region    _set_ver(release_region, f41d6d31)
  2733. +#define wake_up    _set_ver(wake_up, e8d71419)
  2734. +#define wake_up_interruptible    _set_ver(wake_up_interruptible, 64c8cb92)
  2735. +#define sleep_on    _set_ver(sleep_on, 67a00cee)
  2736. +#define interruptible_sleep_on    _set_ver(interruptible_sleep_on, 6a5fc80d)
  2737. +#define schedule    _set_ver(schedule, 01000e51)
  2738. +#define current    _set_ver(current, fc1cb29b)
  2739. +#define jiffies    _set_ver(jiffies, 2f7c7437)
  2740. +#define xtime    _set_ver(xtime, e70c0be0)
  2741. +#define loops_per_sec    _set_ver(loops_per_sec, 40a14192)
  2742. +#define need_resched    _set_ver(need_resched, dfc016ea)
  2743. +#define kill_proc    _set_ver(kill_proc, 911f760a)
  2744. +#define kill_pg    _set_ver(kill_pg, 0a758a45)
  2745. +#define kill_sl    _set_ver(kill_sl, 49625e94)
  2746. +#define panic    _set_ver(panic, 400c0de3)
  2747. +#define printk    _set_ver(printk, ad1148ba)
  2748. +#define sprintf    _set_ver(sprintf, f9003107)
  2749. +#define vsprintf    _set_ver(vsprintf, e605cb6b)
  2750. +#define simple_strtoul    _set_ver(simple_strtoul, bdb8c1e3)
  2751. +#define system_utsname    _set_ver(system_utsname, 066845bc)
  2752. +#define sys_call_table    _set_ver(sys_call_table, 79fa4011)
  2753. +#define do_signal    _set_ver(do_signal, 86f9bc59)
  2754. +#define send_sig    _set_ver(send_sig, 5cddd8d9)
  2755. +#define setup_arg_pages    _set_ver(setup_arg_pages, fe68d94a)
  2756. +#define copy_strings    _set_ver(copy_strings, 232aee96)
  2757. +#define create_tables    _set_ver(create_tables, ba788fa2)
  2758. +#define do_execve    _set_ver(do_execve, 8c99dc0a)
  2759. +#define flush_old_exec    _set_ver(flush_old_exec, c737e178)
  2760. +#define open_inode    _set_ver(open_inode, 27302cb6)
  2761. +#define read_exec    _set_ver(read_exec, a80a2dd0)
  2762. +#define si_meminfo    _set_ver(si_meminfo, bb05fc9a)
  2763. +#define sock_register    _set_ver(sock_register, d68e1649)
  2764. +#define sock_unregister    _set_ver(sock_unregister, 72c332bd)
  2765. +#define inet_add_protocol    _set_ver(inet_add_protocol, ff15a03c)
  2766. +#define inet_del_protocol    _set_ver(inet_del_protocol, a9c5e9c0)
  2767. +#define register_netdevice_notifier    _set_ver(register_netdevice_notifier, e7aace7c)
  2768. +#define unregister_netdevice_notifier    _set_ver(unregister_netdevice_notifier, be114416)
  2769. +#define floppy_track_buffer    _set_ver(floppy_track_buffer, c6e3f7c2)
  2770. +#define register_netdev    _set_ver(register_netdev, 298819f5)
  2771. +#define unregister_netdev    _set_ver(unregister_netdev, f1aa84e4)
  2772. +#define ether_setup    _set_ver(ether_setup, 580a0211)
  2773. +#define alloc_skb    _set_ver(alloc_skb, 2bad9df4)
  2774. +#define kfree_skb    _set_ver(kfree_skb, 75c31065)
  2775. +#define dev_kfree_skb    _set_ver(dev_kfree_skb, e7dae270)
  2776. +#define netif_rx    _set_ver(netif_rx, 67a4d7e8)
  2777. +#define dev_rint    _set_ver(dev_rint, f09d59b2)
  2778. +#define dev_tint    _set_ver(dev_tint, 71e683aa)
  2779. +#define irq2dev_map    _set_ver(irq2dev_map, 10bdcd8a)
  2780. +#define dev_add_pack    _set_ver(dev_add_pack, 672cd2ba)
  2781. +#define dev_remove_pack    _set_ver(dev_remove_pack, 08d1ec09)
  2782. +#define dev_get    _set_ver(dev_get, 53977feb)
  2783. +#define dev_ioctl    _set_ver(dev_ioctl, 08760203)
  2784. +#define dev_queue_xmit    _set_ver(dev_queue_xmit, 9927ca95)
  2785. +#define dev_base    _set_ver(dev_base, 1d36a3cf)
  2786. +#define dev_close    _set_ver(dev_close, 98484140)
  2787. +#define arp_find    _set_ver(arp_find, d909c1c9)
  2788. +#define n_tty_ioctl    _set_ver(n_tty_ioctl, 538e5fa6)
  2789. +#define tty_register_ldisc    _set_ver(tty_register_ldisc, 8fdde939)
  2790. +#define kill_fasync    _set_ver(kill_fasync, 890501b6)
  2791. +#define in_scan_scsis    _set_ver(in_scan_scsis, 21874a88)
  2792. +#define scsi_register_module    _set_ver(scsi_register_module, 8eff1010)
  2793. +#define scsi_unregister_module    _set_ver(scsi_unregister_module, d913b8f0)
  2794. +#define scsi_free    _set_ver(scsi_free, 475dddfa)
  2795. +#define scsi_malloc    _set_ver(scsi_malloc, 1cce3f92)
  2796. +#define scsi_register    _set_ver(scsi_register, d6e77069)
  2797. +#define scsi_unregister    _set_ver(scsi_unregister, 3b0b616b)
  2798. +#define scsicam_bios_param    _set_ver(scsicam_bios_param, 3d965248)
  2799. +#define scsi_init_malloc    _set_ver(scsi_init_malloc, e5167cbc)
  2800. +#define scsi_init_free    _set_ver(scsi_init_free, 8b2721f8)
  2801. +#define print_command    _set_ver(print_command, 6f14cd75)
  2802. +#define print_msg    _set_ver(print_msg, 0465f877)
  2803. +#define print_status    _set_ver(print_status, 32f84646)
  2804. +#define set_writetime    _set_ver(set_writetime, 52131916)
  2805. +#define sys_tz    _set_ver(sys_tz, aa3c9782)
  2806. +#define __wait_on_super    _set_ver(__wait_on_super, 61a5c00a)
  2807. +#define file_fsync    _set_ver(file_fsync, d30a190f)
  2808. +#define clear_inode    _set_ver(clear_inode, da2b0e9f)
  2809. +#define refile_buffer    _set_ver(refile_buffer, 8c69e123)
  2810. +#define ___strtok    _set_ver(___strtok, 8b55d69c)
  2811. +#define init_fifo    _set_ver(init_fifo, 082629c7)
  2812. +#define super_blocks    _set_ver(super_blocks, e1f1ee99)
  2813. +#define chrdev_inode_operations    _set_ver(chrdev_inode_operations, 6ba1faa3)
  2814. +#define blkdev_inode_operations    _set_ver(blkdev_inode_operations, ed443696)
  2815. +#define read_ahead    _set_ver(read_ahead, bbcd3768)
  2816. +#define get_hash_table    _set_ver(get_hash_table, 3b5f3c55)
  2817. +#define get_empty_inode    _set_ver(get_empty_inode, 554bdc75)
  2818. +#define insert_inode_hash    _set_ver(insert_inode_hash, 59b8c371)
  2819. +#define event    _set_ver(event, a6aac9c1)
  2820. +#define __down    _set_ver(__down, 75aa9e96)
  2821. +#endif /* _KSYMS_VER_ */
  2822. +#endif /* CONFIG_MODVERSIONS !__GENKSYMS__ */
  2823. diff -u --recursive --new-file linux-1.2.13/include/linux/symtab_begin.h linux/include/linux/symtab_begin.h
  2824. --- linux-1.2.13/include/linux/symtab_begin.h    Mon Jan 23 02:38:30 1995
  2825. +++ linux/include/linux/symtab_begin.h    Thu Aug  3 20:37:02 1995
  2826. @@ -1,16 +1,19 @@
  2827. +#include <linux/linkage.h>
  2828.  #ifdef CONFIG_MODVERSIONS /* CONFIG_MODVERSIONS */
  2829.  #undef _set_ver
  2830.  #undef X
  2831.  #ifndef __GENKSYMS__
  2832.  #ifdef MODULE
  2833. -#define _set_ver(sym,ver) { (void *) & sym ## _R ## ver, "_" #sym "_R" #ver }
  2834. +#define _set_ver(sym,ver) \
  2835. +    { (void *) & sym ## _R ## ver, SYMBOL_NAME_STR(sym) "_R" #ver }
  2836.  #else /* MODULE */
  2837. -#define _set_ver(sym,ver) { (void *) & sym, "_" #sym "_R" #ver }
  2838. +#define _set_ver(sym,ver) \
  2839. +    { (void *) & sym, SYMBOL_NAME_STR(sym) "_R" #ver }
  2840.  #endif /* MODULE */
  2841.  #define X(a) a
  2842.  #endif /* __GENKSYMS__ */
  2843.  #else /* CONFIG_MODVERSIONS */
  2844. -#define X(sym) { (void *) & sym, "_" #sym }
  2845. +#define X(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
  2846.  #endif /* CONFIG_MODVERSIONS */
  2847.  #define EMPTY {0,0}
  2848.      0, 0, 0, {
  2849. diff -u --recursive --new-file linux-1.2.13/include/linux/sys.h linux/include/linux/sys.h
  2850. --- linux-1.2.13/include/linux/sys.h    Wed Feb 22 04:27:52 1995
  2851. +++ linux/include/linux/sys.h    Thu Aug  3 20:37:02 1995
  2852. @@ -27,6 +27,10 @@
  2853.   * These are system calls that haven't been implemented yet
  2854.   * but have an entry in the table for future expansion..
  2855.   */
  2856. +#ifdef __ELF__
  2857. +#define sys_quotactl    sys_ni_syscall
  2858. +#else
  2859.  #define _sys_quotactl    _sys_ni_syscall
  2860. +#endif
  2861.  
  2862.  #endif
  2863. diff -u --recursive --new-file linux-1.2.13/include/linux/timex.h linux/include/linux/timex.h
  2864. --- linux-1.2.13/include/linux/timex.h    Tue Aug  9 01:35:37 1994
  2865. +++ linux/include/linux/timex.h    Thu Aug  3 20:37:02 1995
  2866. @@ -88,6 +88,19 @@
  2867.                   */
  2868.      struct timeval time;    /* (read only) */
  2869.      long tick;        /* (modified) usecs between clock ticks */
  2870. +
  2871. +        long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
  2872. +        long jitter;            /* pps jitter (us) (ro) */
  2873. +        int shift;              /* interval duration (s) (shift) (ro) */
  2874. +        long stabil;            /* pps stability (scaled ppm) (ro) */
  2875. +        long jitcnt;            /* jitter limit exceeded (ro) */
  2876. +        long calcnt;            /* calibration intervals (ro) */
  2877. +        long errcnt;            /* calibration errors (ro) */
  2878. +        long stbcnt;            /* stability limit exceeded (ro) */
  2879. +
  2880. +    int  :32; int  :32; int  :32; int  :32;
  2881. +    int  :32; int  :32; int  :32; int  :32;
  2882. +    int  :32; int  :32; int  :32; int  :32;
  2883.  };
  2884.  
  2885.  /*
  2886. diff -u --recursive --new-file linux-1.2.13/kernel/ksyms.c linux/kernel/ksyms.c
  2887. --- linux-1.2.13/kernel/ksyms.c    Thu Aug  3 20:39:23 1995
  2888. +++ linux/kernel/ksyms.c    Thu Aug  3 20:41:32 1995
  2889. @@ -81,7 +81,8 @@
  2890.  struct symbol_table symbol_table = {
  2891.  #include <linux/symtab_begin.h>
  2892.  #ifdef CONFIG_MODVERSIONS
  2893. -    { (void *)1 /* Version version :-) */, "_Using_Versions" },
  2894. +    { (void *)1 /* Version version :-) */,
  2895. +        SYMBOL_NAME_STR (Using_Versions) },
  2896.  #endif
  2897.      /* stackable module support */
  2898.      X(rename_module_symbol),
  2899.