diff options
author | dim <dim@FreeBSD.org> | 2015-12-31 22:55:02 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-31 22:55:02 +0000 |
commit | bc8f4c6766d9b42a3b5bc686c68cd43e8044462c (patch) | |
tree | 34b4a25c4bc3b0ad56cf20133da5eec165babec9 /lib | |
parent | 5e96169da3835c4e7ba0d43cbe01f0d7b36f67b3 (diff) | |
parent | 64f2c44ad84c0333d3cdc811e04bf59d76f1ef26 (diff) | |
download | FreeBSD-src-bc8f4c6766d9b42a3b5bc686c68cd43e8044462c.zip FreeBSD-src-bc8f4c6766d9b42a3b5bc686c68cd43e8044462c.tar.gz |
Merge ^/head r292951 through r293015.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmd/mdXhl.c | 13 | ||||
-rw-r--r-- | lib/libstand/Makefile | 6 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/libmd/mdXhl.c b/lib/libmd/mdXhl.c index f2e918f..378d8ad 100644 --- a/lib/libmd/mdXhl.c +++ b/lib/libmd/mdXhl.c @@ -59,14 +59,18 @@ MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len) f = open(filename, O_RDONLY); if (f < 0) return 0; - if (fstat(f, &stbuf) < 0) - return 0; + if (fstat(f, &stbuf) < 0) { + i = -1; + goto error; + } if (ofs > stbuf.st_size) ofs = stbuf.st_size; if ((len == 0) || (len > stbuf.st_size - ofs)) len = stbuf.st_size - ofs; - if (lseek(f, ofs, SEEK_SET) < 0) - return 0; + if (lseek(f, ofs, SEEK_SET) < 0) { + i = -1; + goto error; + } n = len; i = 0; while (n > 0) { @@ -79,6 +83,7 @@ MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len) MDXUpdate(&ctx, buffer, i); n -= i; } +error: e = errno; close(f); errno = e; diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index a69a935..3126c1c 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -44,6 +44,12 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC_SRC}/arm/gen +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +CFLAGS.clang+= -mllvm -arm-use-movt=0 +CFLAGS.clang+= -mfpu=none + # Compiler support functions .PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/ # __clzsi2 and ctzsi2 for various builtin functions |