Skip to content

Commit

Permalink
[objcopy][NFC] Rename files to avoid clashing of archive members.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
avl-llvm committed Feb 23, 2022
1 parent 0fc1141 commit 25d7b4f
Show file tree
Hide file tree
Showing 25 changed files with 72 additions and 72 deletions.
16 changes: 8 additions & 8 deletions llvm/lib/ObjCopy/CMakeLists.txt
Expand Up @@ -34,19 +34,19 @@ add_llvm_component_library(LLVMObjCopy
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
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp
Expand Up @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#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"

Expand Down
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Object.h"
#include "COFFObject.h"
#include "llvm/ADT/DenseSet.h"
#include <algorithm>

Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -209,4 +209,4 @@ void copyPeHeader(PeHeader1Ty &Dest, const PeHeader2Ty &Src) {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_COFF_OBJECT_H
#endif // LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -38,4 +38,4 @@ class COFFReader {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_COFF_READER_H
#endif // LLVM_LIB_OBJCOPY_COFF_COFFREADER_H
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -60,4 +60,4 @@ class COFFWriter {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_COFF_WRITER_H
#endif // LLVM_LIB_OBJCOPY_COFF_COFFWRITER_H
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#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"
Expand Down
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Object.h"
#include "ELFObject.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -1110,4 +1110,4 @@ class Object {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_ELF_OBJECT_H
#endif // LLVM_LIB_OBJCOPY_ELF_ELFOBJECT_H
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.h
Expand Up @@ -9,7 +9,7 @@
#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 {
Expand Down
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Object.h"
#include "MachOObject.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <unordered_set>

Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -371,4 +371,4 @@ struct Object {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_MACHO_OBJECT_H
#endif // LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/MachO/MachOReader.cpp
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "MachOReader.h"
#include "Object.h"
#include "MachOObject.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Object/MachO.h"
#include "llvm/Support/Errc.h"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/MachO/MachOReader.h
Expand Up @@ -9,7 +9,7 @@
#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"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/MachO/MachOWriter.cpp
Expand Up @@ -8,7 +8,7 @@

#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"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ObjCopy/MachO/MachOWriter.h
Expand Up @@ -10,7 +10,7 @@
#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"
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp
Expand Up @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#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"
Expand Down
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Object.h"
#include "WasmObject.h"

#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
Expand Down
@@ -1,13 +1,13 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -44,4 +44,4 @@ struct Object {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_WASM_OBJECT_H
#endif // LLVM_LIB_OBJCOPY_WASM_WASMOBJECT_H
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Reader.h"
#include "WasmReader.h"

namespace llvm {
namespace objcopy {
Expand Down
@@ -1,15 +1,15 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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 {
Expand All @@ -28,4 +28,4 @@ class Reader {
} // end namespace objcopy
} // end namespace llvm

#endif // LLVM_LIB_OBJCOPY_WASM_READER_H
#endif // LLVM_LIB_OBJCOPY_WASM_WASMREADER_H
@@ -1,12 +1,12 @@
//===- 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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Writer.h"
#include "WasmWriter.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Errc.h"
Expand Down

0 comments on commit 25d7b4f

Please sign in to comment.