Re: svn commit: r329737 - head/stand/i386/boot2
On Wed, 21 Feb 2018, Benno Rice wrote: On Feb 21, 2018, at 10:46 AM, Colin Percivalwrote: On 02/21/18 10:10, Benno Rice wrote: Curiously, changing whitespace seems to cause the md5 of the .o files to differ these days hence the following testing strategy: Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6) objdump -d only dissassembles the text section (and does a bad job of that, with calls to extern functions printed as e8 fc ff ff ff call on i386 (here 0xe8 is the opcode for the call instruction, and fc ff ff ff is -4 which is a placeholder for the eventual offset, and is the result of adding -4 to the current program counter. The symbol table gives the name of linked address, but the garbage offset is used to form the garbage address instead of printing this name. So objdump -d would miss the large change of calling a different extern function. Is this simply because line numbers are changing? That isn't new; I remember a case where a security advisory touched a .h file and suddenly a huge number of binaries changed because they included header file line numbers. No, it happened when I changed the indent of the while statement on line ~132 in memcpy. I do suspect debug info though. Isn't there a binary compiled without any debug info? Bruce ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r329737 - head/stand/i386/boot2
On 02/21/18 10:10, Benno Rice wrote: > Curiously, changing whitespace seems to cause the md5 of the .o files to > differ > these days hence the following testing strategy: > > Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6) Is this simply because line numbers are changing? That isn't new; I remember a case where a security advisory touched a .h file and suddenly a huge number of binaries changed because they included header file line numbers. > static inline int > strcmp(const char *s1, const char *s2) > { > -for (; *s1 == *s2 && *s1; s1++, s2++); > -return (unsigned char)*s1 - (unsigned char)*s2; > + > + for (; *s1 == *s2 && *s1; s1++, s2++); > + return (unsigned char)*s1 - (unsigned char)*s2; > } -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r329737 - head/stand/i386/boot2
> On Feb 21, 2018, at 10:46 AM, Colin Percivalwrote: > > On 02/21/18 10:10, Benno Rice wrote: >> Curiously, changing whitespace seems to cause the md5 of the .o files to >> differ >> these days hence the following testing strategy: >> >> Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6) > > Is this simply because line numbers are changing? That isn't new; I remember > a case where a security advisory touched a .h file and suddenly a huge number > of binaries changed because they included header file line numbers. No, it happened when I changed the indent of the while statement on line ~132 in memcpy. I do suspect debug info though. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r329737 - head/stand/i386/boot2
On 21 February 2018 at 13:10, Benno Ricewrote: > Author: benno > Date: Wed Feb 21 18:10:50 2018 > New Revision: 329737 > URL: https://svnweb.freebsd.org/changeset/base/329737 > > Log: > Purely whitespace changes bringing this file closer to style(9). > > Curiously, changing whitespace seems to cause the md5 of the .o files to > differ > these days hence the following testing strategy: sysutils/py-diffoscope can aid in finding the source of the differences. If you still have old and new .o files around you can try it online at https://try.diffoscope.org/ . ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r329737 - head/stand/i386/boot2
> On Feb 21, 2018, at 10:51 AM, Ed Mastewrote: > > On 21 February 2018 at 13:10, Benno Rice wrote: >> Author: benno >> Date: Wed Feb 21 18:10:50 2018 >> New Revision: 329737 >> URL: https://svnweb.freebsd.org/changeset/base/329737 >> >> Log: >> Purely whitespace changes bringing this file closer to style(9). >> >> Curiously, changing whitespace seems to cause the md5 of the .o files to >> differ >> these days hence the following testing strategy: > > sysutils/py-diffoscope can aid in finding the source of the > differences. If you still have old and new .o files around you can try > it online at https://try.diffoscope.org/ . Suspicion confirmed. Lots of changes through the debug info, primarily relating to columns. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r329737 - head/stand/i386/boot2
Author: benno Date: Wed Feb 21 18:10:50 2018 New Revision: 329737 URL: https://svnweb.freebsd.org/changeset/base/329737 Log: Purely whitespace changes bringing this file closer to style(9). Curiously, changing whitespace seems to cause the md5 of the .o files to differ these days hence the following testing strategy: Tested by:objdump -d | md5 (both in-tree clang and lang/gcc6) Modified: head/stand/i386/boot2/boot2.c Modified: head/stand/i386/boot2/boot2.c == --- head/stand/i386/boot2/boot2.c Wed Feb 21 18:09:07 2018 (r329736) +++ head/stand/i386/boot2/boot2.c Wed Feb 21 18:10:50 2018 (r329737) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { -RBX_DUAL, -RBX_SERIAL, -RBX_ASKNAME, -RBX_CDROM, -RBX_CONFIG, -RBX_KDB, -RBX_GDB, -RBX_MUTE, -RBX_NOINTR, -RBX_PAUSE, -RBX_QUIET, -RBX_DFLTROOT, -RBX_SINGLE, -RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { -unsigned drive; -unsigned type; -unsigned unit; -uint8_t slice; -uint8_t part; -unsigned start; -int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,18 +126,19 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { -const char *s = src; -char *d = dst; + const char *s = src; + char *d = dst; -while (len--) -*d++ = *s++; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { -for (; *s1 == *s2 && *s1; s1++, s2++); -return (unsigned char)*s1 - (unsigned char)*s2; + + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; } #defineUFS_SMALL_CGBASE @@ -146,501 +147,512 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { -if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; -} -return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; } static inline void getstr(void) { -char *s; -int c; + char *s; + int c; -s = cmd; -for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } } -} } static inline void putc(int c) { -v86.addr = 0x10; -v86.eax = 0xe00 | (c & 0xff); -v86.ebx = 0x7; -v86int(); + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { -uint8_t autoboot; -ufs_ino_t ino; -size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; -dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x1) - __base); -v86.ctl = V86_FLAGS; -v86.efl = PSL_RESERVED_DEFAULT | PSL_I; -dsk.drive = *(uint8_t *)PTOV(ARGS); -dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; -dsk.unit = dsk.drive & DRV_MASK; -dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; -bootinfo.bi_version = BOOTINFO_VERSION; -bootinfo.bi_size =