Remove protected_memory_buildflags.h

Change-Id: I64b78e8fd3beddb0b42cca79ddd2a03fa06e782e
Reviewed-on: https://gn-review.googlesource.com/1160
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
diff --git a/base/memory/protected_memory.h b/base/memory/protected_memory.h
index 3cb2ec3..8d7868f 100644
--- a/base/memory/protected_memory.h
+++ b/base/memory/protected_memory.h
@@ -56,27 +56,12 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/protected_memory_buildflags.h"
 #include "base/synchronization/lock.h"
 #include "build/build_config.h"
 
 #define PROTECTED_MEMORY_ENABLED 1
 
-// Linking with lld is required to workaround crbug.com/792777.
-// TODO(vtsyrklevich): Remove once support for gold on Android/CrOs is dropped
-#if defined(OS_LINUX) && BUILDFLAG(USE_LLD)
-// Define the section read-only
-__asm__(".section protected_memory, \"a\"\n\t");
-#define PROTECTED_MEMORY_SECTION __attribute__((section("protected_memory")))
-
-// Explicitly mark these variables hidden so the symbols are local to the
-// currently built component. Otherwise they are created with global (external)
-// linkage and component builds would break because a single pair of these
-// symbols would override the rest.
-__attribute__((visibility("hidden"))) extern char __start_protected_memory;
-__attribute__((visibility("hidden"))) extern char __stop_protected_memory;
-
-#elif defined(OS_MACOSX) && !defined(OS_IOS)
+#if defined(OS_MACOSX) && !defined(OS_IOS)
 // The segment the section is in is defined read-only with a linker flag in
 // build/config/mac/BUILD.gn
 #define PROTECTED_MEMORY_SECTION \
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
index e964f84..602f43d 100755
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -226,10 +226,6 @@
   root_gen_dir = os.path.join(tempdir, 'gen')
   mkdir_p(root_gen_dir)
 
-  write_buildflag_header_manually(root_gen_dir,
-                                  'base/memory/protected_memory_buildflags.h',
-                                  { 'USE_LLD': 'false' })
-
   write_buildflag_header_manually(root_gen_dir, 'base/cfi_buildflags.h',
       {
           'CFI_CAST_CHECK': 'false',
@@ -259,10 +255,6 @@
     write_compiled_message(root_gen_dir,
         'base/trace_event/etw_manifest/chrome_events_win.man')
 
-  write_buildflag_header_manually(
-      root_gen_dir, 'base/android/library_loader.h',
-      {'USE_LLD': 'false', 'SUPPORTS_CODE_ORDERING': 'false'})
-
   write_gn_ninja(os.path.join(tempdir, 'build.ninja'),
                  root_gen_dir, options, windows_x64_toolchain)
   cmd = ['ninja', '-C', tempdir, '-w', 'dupbuild=err']