From b7e635efd894116530e4fc15847de0aab5915b7e Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Thu, 18 May 2023 02:51:49 +0800
Subject: [PATCH] Minor fix-ups for ppc

---
 cctools/misc/strings.c  | 6 +++++-
 ld64/src/ld/Options.cpp | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git cctools/misc/strings.c cctools/misc/strings.c
index e8d62a7..93d8fea 100644
--- cctools/misc/strings.c
+++ cctools/misc/strings.c
@@ -354,7 +354,11 @@ void *cookie)
 	 * If the ofile is not an object file then process it without reguard
 	 * to sections.
 	 */
-	if(ofile->object_addr == NULL || ofile->member_type == OFILE_LLVM_BITCODE){
+	if(ofile->object_addr == NULL
+#ifdef LTO_SUPPORT
+           || ofile->member_type == OFILE_LLVM_BITCODE
+#endif /* LTO_SUPPORT */
+           ){
 	    if(ofile->file_type == OFILE_FAT && ofile->arch_flag.cputype != 0){
 		if(ofile->fat_header->magic == FAT_MAGIC_64){
 		    addr = ofile->file_addr +
diff --git ld64/src/ld/Options.cpp ld64/src/ld/Options.cpp
index 0ab643d..be01832 100644
--- ld64/src/ld/Options.cpp
+++ ld64/src/ld/Options.cpp
@@ -1704,7 +1704,7 @@ uint32_t Options::parseVersionNumber32(const char* versionString)
 			z = strtoul(&end[1], &end, 10);
 		}
 	}
-	if ( (*end != '\0') || (x > 0xffff) || (y > 0xff) || (z > 0xff) )
+	if ( (x > 0xffff) || (y > 0xff) || (z > 0xff) )
 		throwf("malformed 32-bit x.y.z version number: %s", versionString);
 
 	return (x << 16) | ( y << 8 ) | z;
-- 
2.40.1

