libtool uses file names to name members of an static library.
Files, located in different directories and having matching name,
would have the same name inside an archive. This is not a problem
for ld, but may be a problem for ar. This patch renames files
from ObjCopy library to avoid names clashing.
See https://reviews.llvm.org/D88827#3335814
Differential Revision: https://reviews.llvm.org/D120345
ObjCopy.cpp
ConfigManager.cpp
COFF/COFFObjcopy.cpp
- COFF/Object.cpp
- COFF/Reader.cpp
- COFF/Writer.cpp
+ COFF/COFFObject.cpp
+ COFF/COFFReader.cpp
+ COFF/COFFWriter.cpp
ELF/ELFObjcopy.cpp
- ELF/Object.cpp
+ ELF/ELFObject.cpp
MachO/MachOObjcopy.cpp
MachO/MachOReader.cpp
MachO/MachOWriter.cpp
MachO/MachOLayoutBuilder.cpp
- MachO/Object.cpp
- wasm/Object.cpp
- wasm/Reader.cpp
- wasm/Writer.cpp
+ MachO/MachOObject.cpp
+ wasm/WasmObject.cpp
+ wasm/WasmReader.cpp
+ wasm/WasmWriter.cpp
wasm/WasmObjcopy.cpp
ADDITIONAL_HEADER_DIRS
//===----------------------------------------------------------------------===//
#include "llvm/ObjCopy/COFF/COFFObjcopy.h"
-#include "Object.h"
-#include "Reader.h"
-#include "Writer.h"
+#include "COFFObject.h"
+#include "COFFReader.h"
+#include "COFFWriter.h"
#include "llvm/ObjCopy/COFF/COFFConfig.h"
#include "llvm/ObjCopy/CommonConfig.h"
-//===- Object.cpp ---------------------------------------------------------===//
+//===- COFFObject.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Object.h"
+#include "COFFObject.h"
#include "llvm/ADT/DenseSet.h"
#include <algorithm>
-//===- Object.h -------------------------------------------------*- C++ -*-===//
+//===- COFFObject.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_COFF_OBJECT_H
-#define LLVM_LIB_OBJCOPY_COFF_OBJECT_H
+#ifndef LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
+#define LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_COFF_OBJECT_H
+#endif // LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
-//===- Reader.cpp ---------------------------------------------------------===//
+//===- COFFReader.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Reader.h"
-#include "Object.h"
+#include "COFFReader.h"
+#include "COFFObject.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/COFF.h"
-//===- Reader.h -------------------------------------------------*- C++ -*-===//
+//===- COFFReader.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_COFF_READER_H
-#define LLVM_LIB_OBJCOPY_COFF_READER_H
+#ifndef LLVM_LIB_OBJCOPY_COFF_COFFREADER_H
+#define LLVM_LIB_OBJCOPY_COFF_COFFREADER_H
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/COFF.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_COFF_READER_H
+#endif // LLVM_LIB_OBJCOPY_COFF_COFFREADER_H
-//===- Writer.cpp ---------------------------------------------------------===//
+//===- COFFWriter.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Writer.h"
-#include "Object.h"
+#include "COFFWriter.h"
+#include "COFFObject.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/COFF.h"
-//===- Writer.h -------------------------------------------------*- C++ -*-===//
+//===- COFFWriter.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_COFF_WRITER_H
-#define LLVM_LIB_OBJCOPY_COFF_WRITER_H
+#ifndef LLVM_LIB_OBJCOPY_COFF_COFFWRITER_H
+#define LLVM_LIB_OBJCOPY_COFF_COFFWRITER_H
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Support/Error.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_COFF_WRITER_H
+#endif // LLVM_LIB_OBJCOPY_COFF_COFFWRITER_H
//===----------------------------------------------------------------------===//
#include "llvm/ObjCopy/ELF/ELFObjcopy.h"
-#include "Object.h"
+#include "ELFObject.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Optional.h"
-//===- Object.cpp ---------------------------------------------------------===//
+//===- ELFObject.cpp ------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Object.h"
+#include "ELFObject.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
-//===- Object.h -------------------------------------------------*- C++ -*-===//
+//===- ELFObject.h ----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_ELF_OBJECT_H
-#define LLVM_LIB_OBJCOPY_ELF_OBJECT_H
+#ifndef LLVM_LIB_OBJCOPY_ELF_ELFOBJECT_H
+#define LLVM_LIB_OBJCOPY_ELF_ELFOBJECT_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_ELF_OBJECT_H
+#endif // LLVM_LIB_OBJCOPY_ELF_ELFOBJECT_H
#ifndef LLVM_LIB_OBJCOPY_MACHO_MACHOLAYOUTBUILDER_H
#define LLVM_LIB_OBJCOPY_MACHO_MACHOLAYOUTBUILDER_H
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/ObjCopy/MachO/MachOObjcopy.h"
namespace llvm {
-//===- Object.cpp - Mach-O object file model --------------------*- C++ -*-===//
+//===- MachOObject.cpp - Mach-O object file model ---------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <unordered_set>
-//===- Object.h - Mach-O object file model ----------------------*- C++ -*-===//
+//===- MachOObject.h - Mach-O object file model -----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_MACHO_OBJECT_H
-#define LLVM_LIB_OBJCOPY_MACHO_OBJECT_H
+#ifndef LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
+#define LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_MACHO_OBJECT_H
+#endif // LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
//===----------------------------------------------------------------------===//
#include "MachOReader.h"
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Object/MachO.h"
#include "llvm/Support/Errc.h"
#ifndef LLVM_LIB_OBJCOPY_MACHO_MACHOREADER_H
#define LLVM_LIB_OBJCOPY_MACHO_MACHOREADER_H
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/ObjCopy/MachO/MachOObjcopy.h"
#include "llvm/Object/MachO.h"
#include "MachOWriter.h"
#include "MachOLayoutBuilder.h"
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Object/MachO.h"
#define LLVM_LIB_OBJCOPY_MACHO_MACHOWRITER_H
#include "MachOLayoutBuilder.h"
-#include "Object.h"
+#include "MachOObject.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/ObjCopy/MachO/MachOObjcopy.h"
#include "llvm/Object/MachO.h"
//===----------------------------------------------------------------------===//
#include "llvm/ObjCopy/wasm/WasmObjcopy.h"
-#include "Object.h"
-#include "Reader.h"
-#include "Writer.h"
+#include "WasmObject.h"
+#include "WasmReader.h"
+#include "WasmWriter.h"
#include "llvm/ObjCopy/CommonConfig.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileOutputBuffer.h"
-//===- Object.cpp ---------------------------------------------------------===//
+//===- WasmObject.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Object.h"
+#include "WasmObject.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
-//===- Object.h -------------------------------------------------*- C++ -*-===//
+//===- WasmObject.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_WASM_OBJECT_H
-#define LLVM_LIB_OBJCOPY_WASM_OBJECT_H
+#ifndef LLVM_LIB_OBJCOPY_WASM_WASMOBJECT_H
+#define LLVM_LIB_OBJCOPY_WASM_WASMOBJECT_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_WASM_OBJECT_H
+#endif // LLVM_LIB_OBJCOPY_WASM_WASMOBJECT_H
-//===- Reader.cpp ---------------------------------------------------------===//
+//===- WasmReader.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Reader.h"
+#include "WasmReader.h"
namespace llvm {
namespace objcopy {
-//===- Reader.h -------------------------------------------------*- C++ -*-===//
+//===- WasmReader.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_WASM_READER_H
-#define LLVM_LIB_OBJCOPY_WASM_READER_H
+#ifndef LLVM_LIB_OBJCOPY_WASM_WASMREADER_H
+#define LLVM_LIB_OBJCOPY_WASM_WASMREADER_H
-#include "Object.h"
+#include "WasmObject.h"
namespace llvm {
namespace objcopy {
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_WASM_READER_H
+#endif // LLVM_LIB_OBJCOPY_WASM_WASMREADER_H
-//===- Writer.cpp ---------------------------------------------------------===//
+//===- WasmWriter.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#include "Writer.h"
+#include "WasmWriter.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Errc.h"
-//===- Writer.h -------------------------------------------------*- C++ -*-===//
+//===- WasmWriter.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIB_OBJCOPY_WASM_WRITER_H
-#define LLVM_LIB_OBJCOPY_WASM_WRITER_H
+#ifndef LLVM_LIB_OBJCOPY_WASM_WASMWRITER_H
+#define LLVM_LIB_OBJCOPY_WASM_WASMWRITER_H
-#include "Object.h"
+#include "WasmObject.h"
#include <cstdint>
#include <vector>
} // end namespace objcopy
} // end namespace llvm
-#endif // LLVM_LIB_OBJCOPY_WASM_WRITER_H
+#endif // LLVM_LIB_OBJCOPY_WASM_WASMWRITER_H