This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Incorrect dlltool changes
- To: binutils@sourceware.cygnus.com
- Subject: Incorrect dlltool changes
- From: jeffdbREMOVETHIS@goodnet.com (Mikey)
- Date: Tue, 25 May 1999 07:10:14 GMT
- Organization: Never
- Reply-To: jeffdbREMOVETHIS@goodnet.com
I don't know about any other platform, but the following changes
break creating the reloc section for cygwin1.dll on x86 w95
if (d_list)
{
fprintf (f, "\t.section .rdata\n");
@@ -1827,6 +1938,8 @@
int src;
int dst = 0;
int last = -1;
+ int totsize = 0;
+
qsort (copy, num_entries, sizeof (long), sfunc);
/* Delete duplcates */
for (src = 0; src < num_entries; src++)
@@ -1840,18 +1953,31 @@
on_page = 0;
for (j = 0; j < num_entries; j++)
{
+ totsize += 2;
addr = copy[j];
if ((addr & PAGE_MASK) != page_addr)
{
+ totsize += 8 + (on_page & 1)*2;
flush_page (f, need, page_addr, on_page);
on_page = 0;
page_addr = addr & PAGE_MASK;
}
need[on_page++] = addr;
}
+
+ /* Pad the section to an even 32-byte boundary. This will make
+ the BeOS loader much happier, and shouldn't matter for other
+ OSes. */
+ while ((totsize + 8 + (on_page & 1)*2) % 32 != 0)
+ {
+ /* 0x0000 is an absolute relocation that should be ignored. */
+ need[on_page++] = 0x0000;
+ totsize += 2;
+ }
+
flush_page (f, need, page_addr, on_page);
-/* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
+ /* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
}
}
@@ -1863,7 +1989,7 @@
sprintf (outfile, "%s -o %s %s", as_flags, exp_name, TMP_ASM);
/c/src/obj/ld/ld-new --base-file=cygwin.base -s --dll setjmp.o longjmp.o ../libiberty/random.o ../libiberty/strsignal.o regexp/regexp.o regexp/regerror.o regexp/regsub.o assert.o dcrt0.o debug.o delqueue.o dir.o dlfcn.o dll_init.o environ.o errno.o exceptions.o exec.o external.o fcntl.o fhandler.o fhandler_console.o fhandler_serial.o fhandler_termios.o fhandler_tty.o fhandler_windows.o fhandler_raw.o fhandler_floppy.o fhandler_tape.o fork.o glob.o grp.o heap.o hinfo.o init.o ioctl.o malloc.o mmap.o net.o ntea.o passwd.o path.o pinfo.o pipe.o registry.o resource.o scandir.o security.o select.o shared.o signal.o sigproc.o smallprint.o spawn.o strace.o strsep.o syscalls.o sysconf.o syslog.o termios.o times.o tty.o uinfo.o uname.o wait.o window.o version.o -lkernel32.lib -luser32.lib -ladvapi32.lib -lnetapi32.lib ../newlib/libm.a ../newlib/libc.a c:/test-gcc/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/egcs-2.91.66/libgcc.a -e _dll_entry@12 --image-base=0x61000000
/c/src/obj/binutils/dlltool --as=/c/src/obj/gas/as-new --dllname cygwin1.dll --def cygwin.def --base-file cygwin.base --output-exp cygwin.exp
dc.s: Assembler messages:
dc.s:18937: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18938: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18939: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18940: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18941: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18942: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18943: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18944: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18945: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18946: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18947: Warning: Value 0xfffab000 truncated to 0xb000.
dc.s:18948: Warning: Value 0xfffab000 truncated to 0xb000.
/c/src/obj/ld/ld-new --base-file=cygwin.base cygwin.exp -s --dll setjmp.o longjmp.o ../libiberty/random.o ../libiberty/strsignal.o regexp/regexp.o regexp/regerror.o regexp/regsub.o assert.o dcrt0.o debug.o delqueue.o dir.o dlfcn.o dll_init.o environ.o errno.o exceptions.o exec.o external.o fcntl.o fhandler.o fhandler_console.o fhandler_serial.o fhandler_termios.o fhandler_tty.o fhandler_windows.o fhandler_raw.o fhandler_floppy.o fhandler_tape.o fork.o glob.o grp.o heap.o hinfo.o init.o ioctl.o malloc.o mmap.o net.o ntea.o passwd.o path.o pinfo.o pipe.o registry.o resource.o scandir.o security.o select.o shared.o signal.o sigproc.o smallprint.o spawn.o strace.o strsep.o syscalls.o sysconf.o syslog.o termios.o times.o tty.o uinfo.o uname.o wait.o window.o version.o -lkernel32.lib -luser32.lib -ladvapi32.lib -lnetapi32.lib ../newlib/libm.a ../newlib/libc.a c:/test-gcc/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/egcs-2.91.66/libgcc.a -e _dll_entry@12 --image-base=0x61000000
/c/src/obj/binutils/dlltool --as=/c/src/obj/gas/as-new --dllname cygwin1.dll --def cygwin.def --base-file cygwin.base --output-exp cygwin.exp
dc.s: Assembler messages:
dc.s:23263: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23264: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23265: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23266: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23267: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23268: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23269: Warning: Value 0xfff8f000 truncated to 0xf000.
dc.s:23270: Warning: Value 0xfff8f000 truncated to 0xf000.
/c/src/obj/ld/ld-new cygwin.exp -o new-cygwin1.dll --dll setjmp.o longjmp.o ../libiberty/random.o ../libiberty/strsignal.o regexp/regexp.o regexp/regerror.o regexp/regsub.o assert.o dcrt0.o debug.o delqueue.o dir.o dlfcn.o dll_init.o environ.o errno.o exceptions.o exec.o external.o fcntl.o fhandler.o fhandler_console.o fhandler_serial.o fhandler_termios.o fhandler_tty.o fhandler_windows.o fhandler_raw.o fhandler_floppy.o fhandler_tape.o fork.o glob.o grp.o heap.o hinfo.o init.o ioctl.o malloc.o mmap.o net.o ntea.o passwd.o path.o pinfo.o pipe.o registry.o resource.o scandir.o security.o select.o shared.o signal.o sigproc.o smallprint.o spawn.o strace.o strsep.o syscalls.o sysconf.o syslog.o termios.o times.o tty.o uinfo.o uname.o wait.o window.o version.o -lkernel32.lib -luser32.lib -ladvapi32.lib -lnetapi32.lib ../newlib/libm.a ../newlib/libc.a c:/test-gcc/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/egcs-2.91.66/libgcc.a -e _dll_entry@12 --image-base=0x61000000
make[1]: Entering directory `/c/src/obj/i586-cygwin32/winsup
Objdump --all-headers new-cygwin1.dll is truncated in the
middle of the reloc section.
Reverting these changes gives correct output both in the
build and from objdump.
Maybe they should be made BeOS specific?