kandi background
Explore Kits

one-elf | ELF reader in Java

 by   odnoklassniki Java Version: Current License: Apache-2.0

 by   odnoklassniki Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | one-elf Summary

one-elf is a Java library. one-elf has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However one-elf build file is not available. You can download it from GitHub.
ELF reader in Java.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • one-elf has a low active ecosystem.
  • It has 15 star(s) with 5 fork(s). There are 12 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 0 open issues and 1 have been closed. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of one-elf is current.
one-elf Support
Best in #Java
Average in #Java
one-elf Support
Best in #Java
Average in #Java

quality kandi Quality

  • one-elf has 0 bugs and 0 code smells.
one-elf Quality
Best in #Java
Average in #Java
one-elf Quality
Best in #Java
Average in #Java

securitySecurity

  • one-elf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • one-elf code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
one-elf Security
Best in #Java
Average in #Java
one-elf Security
Best in #Java
Average in #Java

license License

  • one-elf is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
one-elf License
Best in #Java
Average in #Java
one-elf License
Best in #Java
Average in #Java

buildReuse

  • one-elf releases are not available. You will need to build from source code and install.
  • one-elf has no build file. You will be need to create the build yourself to build the component from source.
  • one-elf saves you 377 person hours of effort in developing the same functionality from scratch.
  • It has 899 lines of code, 97 functions and 16 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
one-elf Reuse
Best in #Java
Average in #Java
one-elf Reuse
Best in #Java
Average in #Java
Top functions reviewed by kandi - BETA

kandi has reviewed one-elf and discovered the below as its top functions. This is intended to give you an instant insight into one-elf implemented functionality, and help decide if they suit your requirements.

  • Returns an iterator over all of the symbols in this set .
    • Reads a subsection .
      • Read directory types .
        • Reads a string from the buffer .
          • Gets a specific section with the given name .
            • Get the relocations .
              • Returns a string representation of this virtual address .
                • Returns true if the address is empty .
                  • The long value
                    • Gets the addendend .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      one-elf Key Features

                      ELF reader in Java

                      How do I really disable all rustc optimizations?

                      copy iconCopydownload iconDownload
                      cargo rustc -- --emit mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let _1: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          scope 1 {
                              debug a => _1;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _2: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _2;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _3: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _3;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              _1 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              _2 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              _3 = const 28_u64;               // scope 2 at src\main.rs:8:18: 8:23
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb1: {
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- -Z mir-opt-level=0 --emir mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let mut _1: !;                       // in scope 0 at src\main.rs:5:33: 11:2
                          let _2: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          let mut _5: u64;                     // in scope 0 at src\main.rs:8:18: 8:19
                          let mut _6: u64;                     // in scope 0 at src\main.rs:8:22: 8:23
                          let mut _7: (u64, bool);             // in scope 0 at src\main.rs:8:18: 8:23
                          let mut _8: !;                       // in scope 0 at src\main.rs:10:5: 10:12
                          let mut _9: ();                      // in scope 0 at src\main.rs:5:1: 11:2
                          scope 1 {
                              debug a => _2;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _3: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _3;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _4: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _4;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              StorageLive(_1);                 // scope 0 at src\main.rs:5:33: 11:2
                              StorageLive(_2);                 // scope 0 at src\main.rs:6:9: 6:10
                              _2 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              StorageLive(_3);                 // scope 1 at src\main.rs:7:9: 7:10
                              _3 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              StorageLive(_4);                 // scope 2 at src\main.rs:8:9: 8:10
                              StorageLive(_5);                 // scope 2 at src\main.rs:8:18: 8:19
                              _5 = _2;                         // scope 2 at src\main.rs:8:18: 8:19
                              StorageLive(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              _6 = _3;                         // scope 2 at src\main.rs:8:22: 8:23
                              _7 = CheckedMul(_5, _6);         // scope 2 at src\main.rs:8:18: 8:23
                              assert(!move (_7.1: bool), "attempt to compute `{} * {}`, which would overflow", move _5, move _6) -> bb1; // scope 2 at src\main.rs:8:18: 8:23
                          }
                      
                          bb1: {
                              _4 = move (_7.0: u64);           // scope 2 at src\main.rs:8:18: 8:23
                              StorageDead(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageDead(_5);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageLive(_8);                 // scope 3 at src\main.rs:10:5: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb2: {
                              _9 = const ();                   // scope 3 at src\main.rs:10:10: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- --emit mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let _1: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          scope 1 {
                              debug a => _1;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _2: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _2;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _3: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _3;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              _1 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              _2 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              _3 = const 28_u64;               // scope 2 at src\main.rs:8:18: 8:23
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb1: {
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- -Z mir-opt-level=0 --emir mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let mut _1: !;                       // in scope 0 at src\main.rs:5:33: 11:2
                          let _2: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          let mut _5: u64;                     // in scope 0 at src\main.rs:8:18: 8:19
                          let mut _6: u64;                     // in scope 0 at src\main.rs:8:22: 8:23
                          let mut _7: (u64, bool);             // in scope 0 at src\main.rs:8:18: 8:23
                          let mut _8: !;                       // in scope 0 at src\main.rs:10:5: 10:12
                          let mut _9: ();                      // in scope 0 at src\main.rs:5:1: 11:2
                          scope 1 {
                              debug a => _2;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _3: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _3;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _4: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _4;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              StorageLive(_1);                 // scope 0 at src\main.rs:5:33: 11:2
                              StorageLive(_2);                 // scope 0 at src\main.rs:6:9: 6:10
                              _2 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              StorageLive(_3);                 // scope 1 at src\main.rs:7:9: 7:10
                              _3 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              StorageLive(_4);                 // scope 2 at src\main.rs:8:9: 8:10
                              StorageLive(_5);                 // scope 2 at src\main.rs:8:18: 8:19
                              _5 = _2;                         // scope 2 at src\main.rs:8:18: 8:19
                              StorageLive(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              _6 = _3;                         // scope 2 at src\main.rs:8:22: 8:23
                              _7 = CheckedMul(_5, _6);         // scope 2 at src\main.rs:8:18: 8:23
                              assert(!move (_7.1: bool), "attempt to compute `{} * {}`, which would overflow", move _5, move _6) -> bb1; // scope 2 at src\main.rs:8:18: 8:23
                          }
                      
                          bb1: {
                              _4 = move (_7.0: u64);           // scope 2 at src\main.rs:8:18: 8:23
                              StorageDead(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageDead(_5);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageLive(_8);                 // scope 3 at src\main.rs:10:5: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb2: {
                              _9 = const ();                   // scope 3 at src\main.rs:10:10: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- --emit mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let _1: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          scope 1 {
                              debug a => _1;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _2: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _2;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _3: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _3;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              _1 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              _2 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              _3 = const 28_u64;               // scope 2 at src\main.rs:8:18: 8:23
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb1: {
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- -Z mir-opt-level=0 --emir mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let mut _1: !;                       // in scope 0 at src\main.rs:5:33: 11:2
                          let _2: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          let mut _5: u64;                     // in scope 0 at src\main.rs:8:18: 8:19
                          let mut _6: u64;                     // in scope 0 at src\main.rs:8:22: 8:23
                          let mut _7: (u64, bool);             // in scope 0 at src\main.rs:8:18: 8:23
                          let mut _8: !;                       // in scope 0 at src\main.rs:10:5: 10:12
                          let mut _9: ();                      // in scope 0 at src\main.rs:5:1: 11:2
                          scope 1 {
                              debug a => _2;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _3: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _3;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _4: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _4;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              StorageLive(_1);                 // scope 0 at src\main.rs:5:33: 11:2
                              StorageLive(_2);                 // scope 0 at src\main.rs:6:9: 6:10
                              _2 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              StorageLive(_3);                 // scope 1 at src\main.rs:7:9: 7:10
                              _3 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              StorageLive(_4);                 // scope 2 at src\main.rs:8:9: 8:10
                              StorageLive(_5);                 // scope 2 at src\main.rs:8:18: 8:19
                              _5 = _2;                         // scope 2 at src\main.rs:8:18: 8:19
                              StorageLive(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              _6 = _3;                         // scope 2 at src\main.rs:8:22: 8:23
                              _7 = CheckedMul(_5, _6);         // scope 2 at src\main.rs:8:18: 8:23
                              assert(!move (_7.1: bool), "attempt to compute `{} * {}`, which would overflow", move _5, move _6) -> bb1; // scope 2 at src\main.rs:8:18: 8:23
                          }
                      
                          bb1: {
                              _4 = move (_7.0: u64);           // scope 2 at src\main.rs:8:18: 8:23
                              StorageDead(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageDead(_5);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageLive(_8);                 // scope 3 at src\main.rs:10:5: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb2: {
                              _9 = const ();                   // scope 3 at src\main.rs:10:10: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- --emit mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let _1: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          scope 1 {
                              debug a => _1;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _2: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _2;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _3: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _3;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              _1 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              _2 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              _3 = const 28_u64;               // scope 2 at src\main.rs:8:18: 8:23
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb1: {
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      
                      cargo rustc -- -Z mir-opt-level=0 --emir mir
                      
                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let mut _1: !;                       // in scope 0 at src\main.rs:5:33: 11:2
                          let _2: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          let mut _5: u64;                     // in scope 0 at src\main.rs:8:18: 8:19
                          let mut _6: u64;                     // in scope 0 at src\main.rs:8:22: 8:23
                          let mut _7: (u64, bool);             // in scope 0 at src\main.rs:8:18: 8:23
                          let mut _8: !;                       // in scope 0 at src\main.rs:10:5: 10:12
                          let mut _9: ();                      // in scope 0 at src\main.rs:5:1: 11:2
                          scope 1 {
                              debug a => _2;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _3: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _3;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _4: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _4;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              StorageLive(_1);                 // scope 0 at src\main.rs:5:33: 11:2
                              StorageLive(_2);                 // scope 0 at src\main.rs:6:9: 6:10
                              _2 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              StorageLive(_3);                 // scope 1 at src\main.rs:7:9: 7:10
                              _3 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              StorageLive(_4);                 // scope 2 at src\main.rs:8:9: 8:10
                              StorageLive(_5);                 // scope 2 at src\main.rs:8:18: 8:19
                              _5 = _2;                         // scope 2 at src\main.rs:8:18: 8:19
                              StorageLive(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              _6 = _3;                         // scope 2 at src\main.rs:8:22: 8:23
                              _7 = CheckedMul(_5, _6);         // scope 2 at src\main.rs:8:18: 8:23
                              assert(!move (_7.1: bool), "attempt to compute `{} * {}`, which would overflow", move _5, move _6) -> bb1; // scope 2 at src\main.rs:8:18: 8:23
                          }
                      
                          bb1: {
                              _4 = move (_7.0: u64);           // scope 2 at src\main.rs:8:18: 8:23
                              StorageDead(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageDead(_5);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageLive(_8);                 // scope 3 at src\main.rs:10:5: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb2: {
                              _9 = const ();                   // scope 3 at src\main.rs:10:10: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      

                      Can't find where preempt count in the stack is declared for a percpu variable access. (linux kernel)

                      copy iconCopydownload iconDownload
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      
                      ({
                          typeof(printk_context) pscr_ret__;
                          __verify_pcpu_ptr(&(printk_context));
                          switch(sizeof(printk_context)) {
                          case 1: pscr_ret__ = this_cpu_read_1(printk_context); break;
                          case 2: pscr_ret__ = this_cpu_read_2(printk_context); break;
                          case 4: pscr_ret__ = this_cpu_read_4(printk_context); break;
                          case 8: pscr_ret__ = this_cpu_read_8(printk_context); break;
                          default:
                              __bad_size_call_parameter(); break;
                          }
                          pscr_ret__;
                      })
                      
                      #define this_cpu_read_4(pcp)        \
                          _pcp_protect_return(__percpu_read_32, pcp)
                      
                      #define _pcp_protect_return(op, pcp, args...)               \
                      ({                                  \
                          typeof(pcp) __retval;                       \
                          preempt_disable_notrace();                  \
                          __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args);    \
                          preempt_enable_notrace();                   \
                          __retval;                           \
                      })
                      
                      #define preempt_enable_notrace() \
                      do { \
                          barrier(); \
                          __preempt_count_dec(); \
                      } while (0)
                      
                      #define preempt_disable_notrace() \
                      do { \
                          __preempt_count_inc(); \
                          barrier(); \
                      } while (0)
                      
                      #define __preempt_count_inc() __preempt_count_add(1)
                      #define __preempt_count_dec() __preempt_count_sub(1)
                      
                      static inline void __preempt_count_add(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc += val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      static inline void __preempt_count_sub(int val)
                      {
                          u32 pc = READ_ONCE(current_thread_info()->preempt.count);
                          pc -= val;
                          WRITE_ONCE(current_thread_info()->preempt.count, pc);
                      }
                      
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                      /*
                       * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
                       * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
                       * including <asm/current.h> can cause a circular dependency on some platforms.
                       */
                      #include <asm/current.h>
                      #define current_thread_info() ((struct thread_info *)current)
                      #endif
                      
                      #define current get_current()
                      
                      /*
                       * We don't use read_sysreg() as we want the compiler to cache the value where
                       * possible.
                       */
                      static __always_inline struct task_struct *get_current(void)
                      {
                          unsigned long sp_el0;
                      
                          asm ("mrs %0, sp_el0" : "=r" (sp_el0));
                      
                          return (struct task_struct *)sp_el0;
                      }
                      
                      struct task_struct {
                      #ifdef CONFIG_THREAD_INFO_IN_TASK
                          /*
                           * For reasons of header soup (see current_thread_info()), this
                           * must be the first element of task_struct.
                           */
                          struct thread_info      thread_info;
                      #endif
                          /* -1 unrunnable, 0 runnable, >0 stopped: */
                          volatile long           state;
                      
                      /*
                       * low level task data that entry.S needs immediate access to.
                       */
                      struct thread_info {
                          unsigned long       flags;      /* low level flags */
                          mm_segment_t        addr_limit; /* address limit */
                      #ifdef CONFIG_ARM64_SW_TTBR0_PAN
                          u64         ttbr0;      /* saved TTBR0_EL1 */
                      #endif
                          union {
                              u64     preempt_count;  /* 0 => preemptible, <0 => bug */
                              struct {
                      #ifdef CONFIG_CPU_BIG_ENDIAN
                                  u32 need_resched;
                                  u32 count;
                      #else
                                  u32 count;
                                  u32 need_resched;
                      #endif
                              } preempt;
                          };
                      };
                      

                      GDB stepping through instructions on a particular core in baremetal development on QEMU

                      copy iconCopydownload iconDownload
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      
                              .global _start
                      _start:
                      1:      wfe
                              b 1b
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -ffreestanding -nostdlib -nostartfiles -Wl,-Ttext=0x80000 -o wfe.elf wfe.s
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump -d wfe.elf
                      
                      wfe.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000080000 <_stack>:
                         80000:       d503205f        wfe
                         80004:       17ffffff        b       80000 <_stack>
                      
                      /opt/qemu-6.2.0/bin/qemu-system-aarch64 -M raspi3b -kernel wfe.elf -display none -S -s
                      
                      /opt/gdb/gdb-10.1-aarch64-elf-x86_64-linux-gnu/bin/aarch64-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      
                      GNU gdb (GDB) 10.1
                      Copyright (C) 2020 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://www.gnu.org/software/gdb/bugs/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word".
                      Remote debugging using localhost:1234
                      warning: No executable has been specified and target does not support
                      determining executable automatically.  Try using the "file" command.
                      0x0000000000080000 in ?? ()
                      Breakpoint 1 at 0x80000
                      Continuing.
                      [Switching to Thread 1.4]
                      
                      Thread 4 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000
                      (gdb) info threads
                        Id   Target Id                    Frame 
                        1    Thread 1.1 (CPU#0 [running]) 0x0000000000080000 in ?? ()
                        2    Thread 1.2 (CPU#1 [running]) 0x0000000000080000 in ?? ()
                        3    Thread 1.3 (CPU#2 [running]) 0x0000000000080000 in ?? ()
                      * 4    Thread 1.4 (CPU#3 [running]) 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, 0x0000000000080000 in ?? ()
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000  thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, 0x0000000000080000 in ?? ()
                      (gdb) 
                      
                      /opt/arm/10/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb wfe.elf -ex 'target remote localhost:1234' -ex 'break *0x80000' -ex 'continue'
                      GNU gdb (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.2.90.20210621-git
                      Copyright (C) 2021 Free Software Foundation, Inc.
                      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      Type "show copying" and "show warranty" for details.
                      This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-none-elf".
                      Type "show configuration" for configuration details.
                      For bug reporting instructions, please see:
                      <https://bugs.linaro.org/>.
                      Find the GDB manual and other documentation resources online at:
                          <http://www.gnu.org/software/gdb/documentation/>.
                      
                      For help, type "help".
                      Type "apropos word" to search for commands related to "word"...
                      Reading symbols from wfe.elf...
                      Remote debugging using localhost:1234
                      _start () at wfe.s:3
                      3       1:      wfe
                      Breakpoint 1 at 0x80000: file wfe.s, line 3.
                      Continuing.
                      
                      Thread 1 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) break *0x80000 thread 2
                      Note: breakpoint 1 (all threads) also set at pc 0x80000.
                      Breakpoint 2 at 0x80000: file wfe.s, line 3.
                      (gdb)  info threads
                        Id   Target Id                    Frame 
                      * 1    Thread 1.1 (CPU#0 [running]) _start () at wfe.s:3
                        2    Thread 1.2 (CPU#1 [running]) _start () at wfe.s:3
                        3    Thread 1.3 (CPU#2 [running]) _start () at wfe.s:3
                        4    Thread 1.4 (CPU#3 [running]) _start () at wfe.s:3
                      (gdb) c
                      Continuing.
                      [Switching to Thread 1.2]
                      
                      Thread 2 hit Breakpoint 1, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      1       breakpoint     keep y   0x0000000000080000 wfe.s:3
                              breakpoint already hit 2 times
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) del 1
                      (gdb) info b
                      Num     Type           Disp Enb Address            What
                      2       breakpoint     keep y   0x0000000000080000 wfe.s:3 thread 2
                              stop only in thread 2
                              breakpoint already hit 1 time
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) c
                      Continuing.
                      
                      Thread 2 hit Breakpoint 2, _start () at wfe.s:3
                      3       1:      wfe
                      (gdb) 
                      

                      How does `Depends on` and `Selected by` work in Kconfig when they conflict

                      copy iconCopydownload iconDownload
                      config SPL
                              bool
                              depends on SUPPORT_SPL
                              prompt "Enable SPL"
                              help
                                If you want to build SPL as well as the normal image, say Y.
                      

                      Unable to blink Raspberry Pi LED using bare metal Rust

                      copy iconCopydownload iconDownload
                      {
                          "llvm-target": "arm-none-eabihf",
                          "target-endian": "little",
                          "target-pointer-width": "32",
                          "target-c-int-width": "32",
                          "os": "none",
                          "env": "eabi",
                          "vendor": "unknown",
                          "arch": "arm",
                          "linker-flavor": "ld",
                          "linker": "arm-none-eabi-ld",
                          "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
                          "executables": true,
                          "relocation-model": "static",
                          "no-compiler-rt": true
                      }
                      

                      linked output sections overlap in address

                      copy iconCopydownload iconDownload
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        }
                       .data : { *(.data) }
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000000000 <_Reset>:
                         0:   58008485    ldr x5, 1090 <stack_top>
                         4:   d5184105    msr sp_el0, x5
                         8:   94000014    bl  58 <c_entry>
                         c:   14000000    b   c <_Reset+0xc>
                      
                      0000000000000010 <print_uart0>:
                        10:   d10043ff    sub sp, sp, #0x10
                        14:   f90007e0    str x0, [sp, #8]
                        18:   14000008    b   38 <print_uart0+0x28>
                        1c:   f94007e0    ldr x0, [sp, #8]
                        20:   39400001    ldrb    w1, [x0]
                        24:   d2a12000    mov x0, #0x9000000              // #150994944
                        28:   b9000001    str w1, [x0]
                        2c:   f94007e0    ldr x0, [sp, #8]
                        30:   91000400    add x0, x0, #0x1
                        34:   f90007e0    str x0, [sp, #8]
                        38:   f94007e0    ldr x0, [sp, #8]
                        3c:   39400000    ldrb    w0, [x0]
                        40:   7100001f    cmp w0, #0x0
                        44:   54fffec1    b.ne    1c <print_uart0+0xc>  // b.any
                        48:   d503201f    nop
                        4c:   d503201f    nop
                        50:   910043ff    add sp, sp, #0x10
                        54:   d65f03c0    ret
                      
                      0000000000000058 <c_entry>:
                        58:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                        5c:   910003fd    mov x29, sp
                        60:   90000000    adrp    x0, 0 <_Reset>
                        64:   91020000    add x0, x0, #0x80
                        68:   97ffffea    bl  10 <print_uart0>
                        6c:   d503201f    nop
                        70:   a8c17bfd    ldp x29, x30, [sp], #16
                        74:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000000000078 <UART0DR>:
                        78:   09000000    .inst   0x09000000 ; undefined
                        7c:   00000000    udf #0
                        80:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                        84:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                        88:   21646c72    .inst   0x21646c72 ; undefined
                        8c:   Address 0x000000000000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        } > ram
                       .data : {
                        *(.data)
                        } > ram
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000040000000 <_Reset>:
                          40000000:   58008485    ldr x5, 40001090 <stack_top>
                          40000004:   d5184105    msr sp_el0, x5
                          40000008:   94000014    bl  40000058 <c_entry>
                          4000000c:   14000000    b   4000000c <_Reset+0xc>
                      
                      0000000040000010 <print_uart0>:
                          40000010:   d10043ff    sub sp, sp, #0x10
                          40000014:   f90007e0    str x0, [sp, #8]
                          40000018:   14000008    b   40000038 <print_uart0+0x28>
                          4000001c:   f94007e0    ldr x0, [sp, #8]
                          40000020:   39400001    ldrb    w1, [x0]
                          40000024:   d2a12000    mov x0, #0x9000000              // #150994944
                          40000028:   b9000001    str w1, [x0]
                          4000002c:   f94007e0    ldr x0, [sp, #8]
                          40000030:   91000400    add x0, x0, #0x1
                          40000034:   f90007e0    str x0, [sp, #8]
                          40000038:   f94007e0    ldr x0, [sp, #8]
                          4000003c:   39400000    ldrb    w0, [x0]
                          40000040:   7100001f    cmp w0, #0x0
                          40000044:   54fffec1    b.ne    4000001c <print_uart0+0xc>  // b.any
                          40000048:   d503201f    nop
                          4000004c:   d503201f    nop
                          40000050:   910043ff    add sp, sp, #0x10
                          40000054:   d65f03c0    ret
                      
                      0000000040000058 <c_entry>:
                          40000058:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                          4000005c:   910003fd    mov x29, sp
                          40000060:   90000000    adrp    x0, 40000000 <_Reset>
                          40000064:   91020000    add x0, x0, #0x80
                          40000068:   97ffffea    bl  40000010 <print_uart0>
                          4000006c:   d503201f    nop
                          40000070:   a8c17bfd    ldp x29, x30, [sp], #16
                          40000074:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000040000078 <UART0DR>:
                          40000078:   09000000    .inst   0x09000000 ; undefined
                          4000007c:   00000000    udf #0
                          40000080:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                          40000084:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                          40000088:   21646c72    .inst   0x21646c72 ; undefined
                          4000008c:   Address 0x000000004000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        }
                       .data : { *(.data) }
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000000000 <_Reset>:
                         0:   58008485    ldr x5, 1090 <stack_top>
                         4:   d5184105    msr sp_el0, x5
                         8:   94000014    bl  58 <c_entry>
                         c:   14000000    b   c <_Reset+0xc>
                      
                      0000000000000010 <print_uart0>:
                        10:   d10043ff    sub sp, sp, #0x10
                        14:   f90007e0    str x0, [sp, #8]
                        18:   14000008    b   38 <print_uart0+0x28>
                        1c:   f94007e0    ldr x0, [sp, #8]
                        20:   39400001    ldrb    w1, [x0]
                        24:   d2a12000    mov x0, #0x9000000              // #150994944
                        28:   b9000001    str w1, [x0]
                        2c:   f94007e0    ldr x0, [sp, #8]
                        30:   91000400    add x0, x0, #0x1
                        34:   f90007e0    str x0, [sp, #8]
                        38:   f94007e0    ldr x0, [sp, #8]
                        3c:   39400000    ldrb    w0, [x0]
                        40:   7100001f    cmp w0, #0x0
                        44:   54fffec1    b.ne    1c <print_uart0+0xc>  // b.any
                        48:   d503201f    nop
                        4c:   d503201f    nop
                        50:   910043ff    add sp, sp, #0x10
                        54:   d65f03c0    ret
                      
                      0000000000000058 <c_entry>:
                        58:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                        5c:   910003fd    mov x29, sp
                        60:   90000000    adrp    x0, 0 <_Reset>
                        64:   91020000    add x0, x0, #0x80
                        68:   97ffffea    bl  10 <print_uart0>
                        6c:   d503201f    nop
                        70:   a8c17bfd    ldp x29, x30, [sp], #16
                        74:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000000000078 <UART0DR>:
                        78:   09000000    .inst   0x09000000 ; undefined
                        7c:   00000000    udf #0
                        80:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                        84:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                        88:   21646c72    .inst   0x21646c72 ; undefined
                        8c:   Address 0x000000000000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        } > ram
                       .data : {
                        *(.data)
                        } > ram
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000040000000 <_Reset>:
                          40000000:   58008485    ldr x5, 40001090 <stack_top>
                          40000004:   d5184105    msr sp_el0, x5
                          40000008:   94000014    bl  40000058 <c_entry>
                          4000000c:   14000000    b   4000000c <_Reset+0xc>
                      
                      0000000040000010 <print_uart0>:
                          40000010:   d10043ff    sub sp, sp, #0x10
                          40000014:   f90007e0    str x0, [sp, #8]
                          40000018:   14000008    b   40000038 <print_uart0+0x28>
                          4000001c:   f94007e0    ldr x0, [sp, #8]
                          40000020:   39400001    ldrb    w1, [x0]
                          40000024:   d2a12000    mov x0, #0x9000000              // #150994944
                          40000028:   b9000001    str w1, [x0]
                          4000002c:   f94007e0    ldr x0, [sp, #8]
                          40000030:   91000400    add x0, x0, #0x1
                          40000034:   f90007e0    str x0, [sp, #8]
                          40000038:   f94007e0    ldr x0, [sp, #8]
                          4000003c:   39400000    ldrb    w0, [x0]
                          40000040:   7100001f    cmp w0, #0x0
                          40000044:   54fffec1    b.ne    4000001c <print_uart0+0xc>  // b.any
                          40000048:   d503201f    nop
                          4000004c:   d503201f    nop
                          40000050:   910043ff    add sp, sp, #0x10
                          40000054:   d65f03c0    ret
                      
                      0000000040000058 <c_entry>:
                          40000058:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                          4000005c:   910003fd    mov x29, sp
                          40000060:   90000000    adrp    x0, 40000000 <_Reset>
                          40000064:   91020000    add x0, x0, #0x80
                          40000068:   97ffffea    bl  40000010 <print_uart0>
                          4000006c:   d503201f    nop
                          40000070:   a8c17bfd    ldp x29, x30, [sp], #16
                          40000074:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000040000078 <UART0DR>:
                          40000078:   09000000    .inst   0x09000000 ; undefined
                          4000007c:   00000000    udf #0
                          40000080:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                          40000084:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                          40000088:   21646c72    .inst   0x21646c72 ; undefined
                          4000008c:   Address 0x000000004000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        }
                       .data : { *(.data) }
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000000000 <_Reset>:
                         0:   58008485    ldr x5, 1090 <stack_top>
                         4:   d5184105    msr sp_el0, x5
                         8:   94000014    bl  58 <c_entry>
                         c:   14000000    b   c <_Reset+0xc>
                      
                      0000000000000010 <print_uart0>:
                        10:   d10043ff    sub sp, sp, #0x10
                        14:   f90007e0    str x0, [sp, #8]
                        18:   14000008    b   38 <print_uart0+0x28>
                        1c:   f94007e0    ldr x0, [sp, #8]
                        20:   39400001    ldrb    w1, [x0]
                        24:   d2a12000    mov x0, #0x9000000              // #150994944
                        28:   b9000001    str w1, [x0]
                        2c:   f94007e0    ldr x0, [sp, #8]
                        30:   91000400    add x0, x0, #0x1
                        34:   f90007e0    str x0, [sp, #8]
                        38:   f94007e0    ldr x0, [sp, #8]
                        3c:   39400000    ldrb    w0, [x0]
                        40:   7100001f    cmp w0, #0x0
                        44:   54fffec1    b.ne    1c <print_uart0+0xc>  // b.any
                        48:   d503201f    nop
                        4c:   d503201f    nop
                        50:   910043ff    add sp, sp, #0x10
                        54:   d65f03c0    ret
                      
                      0000000000000058 <c_entry>:
                        58:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                        5c:   910003fd    mov x29, sp
                        60:   90000000    adrp    x0, 0 <_Reset>
                        64:   91020000    add x0, x0, #0x80
                        68:   97ffffea    bl  10 <print_uart0>
                        6c:   d503201f    nop
                        70:   a8c17bfd    ldp x29, x30, [sp], #16
                        74:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000000000078 <UART0DR>:
                        78:   09000000    .inst   0x09000000 ; undefined
                        7c:   00000000    udf #0
                        80:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                        84:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                        88:   21646c72    .inst   0x21646c72 ; undefined
                        8c:   Address 0x000000000000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        } > ram
                       .data : {
                        *(.data)
                        } > ram
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000040000000 <_Reset>:
                          40000000:   58008485    ldr x5, 40001090 <stack_top>
                          40000004:   d5184105    msr sp_el0, x5
                          40000008:   94000014    bl  40000058 <c_entry>
                          4000000c:   14000000    b   4000000c <_Reset+0xc>
                      
                      0000000040000010 <print_uart0>:
                          40000010:   d10043ff    sub sp, sp, #0x10
                          40000014:   f90007e0    str x0, [sp, #8]
                          40000018:   14000008    b   40000038 <print_uart0+0x28>
                          4000001c:   f94007e0    ldr x0, [sp, #8]
                          40000020:   39400001    ldrb    w1, [x0]
                          40000024:   d2a12000    mov x0, #0x9000000              // #150994944
                          40000028:   b9000001    str w1, [x0]
                          4000002c:   f94007e0    ldr x0, [sp, #8]
                          40000030:   91000400    add x0, x0, #0x1
                          40000034:   f90007e0    str x0, [sp, #8]
                          40000038:   f94007e0    ldr x0, [sp, #8]
                          4000003c:   39400000    ldrb    w0, [x0]
                          40000040:   7100001f    cmp w0, #0x0
                          40000044:   54fffec1    b.ne    4000001c <print_uart0+0xc>  // b.any
                          40000048:   d503201f    nop
                          4000004c:   d503201f    nop
                          40000050:   910043ff    add sp, sp, #0x10
                          40000054:   d65f03c0    ret
                      
                      0000000040000058 <c_entry>:
                          40000058:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                          4000005c:   910003fd    mov x29, sp
                          40000060:   90000000    adrp    x0, 40000000 <_Reset>
                          40000064:   91020000    add x0, x0, #0x80
                          40000068:   97ffffea    bl  40000010 <print_uart0>
                          4000006c:   d503201f    nop
                          40000070:   a8c17bfd    ldp x29, x30, [sp], #16
                          40000074:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000040000078 <UART0DR>:
                          40000078:   09000000    .inst   0x09000000 ; undefined
                          4000007c:   00000000    udf #0
                          40000080:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                          40000084:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                          40000088:   21646c72    .inst   0x21646c72 ; undefined
                          4000008c:   Address 0x000000004000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        }
                       .data : { *(.data) }
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000000000000 <_Reset>:
                         0:   58008485    ldr x5, 1090 <stack_top>
                         4:   d5184105    msr sp_el0, x5
                         8:   94000014    bl  58 <c_entry>
                         c:   14000000    b   c <_Reset+0xc>
                      
                      0000000000000010 <print_uart0>:
                        10:   d10043ff    sub sp, sp, #0x10
                        14:   f90007e0    str x0, [sp, #8]
                        18:   14000008    b   38 <print_uart0+0x28>
                        1c:   f94007e0    ldr x0, [sp, #8]
                        20:   39400001    ldrb    w1, [x0]
                        24:   d2a12000    mov x0, #0x9000000              // #150994944
                        28:   b9000001    str w1, [x0]
                        2c:   f94007e0    ldr x0, [sp, #8]
                        30:   91000400    add x0, x0, #0x1
                        34:   f90007e0    str x0, [sp, #8]
                        38:   f94007e0    ldr x0, [sp, #8]
                        3c:   39400000    ldrb    w0, [x0]
                        40:   7100001f    cmp w0, #0x0
                        44:   54fffec1    b.ne    1c <print_uart0+0xc>  // b.any
                        48:   d503201f    nop
                        4c:   d503201f    nop
                        50:   910043ff    add sp, sp, #0x10
                        54:   d65f03c0    ret
                      
                      0000000000000058 <c_entry>:
                        58:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                        5c:   910003fd    mov x29, sp
                        60:   90000000    adrp    x0, 0 <_Reset>
                        64:   91020000    add x0, x0, #0x80
                        68:   97ffffea    bl  10 <print_uart0>
                        6c:   d503201f    nop
                        70:   a8c17bfd    ldp x29, x30, [sp], #16
                        74:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000000000078 <UART0DR>:
                        78:   09000000    .inst   0x09000000 ; undefined
                        7c:   00000000    udf #0
                        80:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                        84:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                        88:   21646c72    .inst   0x21646c72 ; undefined
                        8c:   Address 0x000000000000008c is out of bounds.
                      
                      /* write for machine virt */
                      ENTRY(_Reset)
                      
                      MEMORY
                      {
                      rm(rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
                      ram (rwx) : ORIGIN = 0x40000000, LENGTH = 0x40000000
                      }
                      
                      SECTIONS
                      {
                       .text : {
                        *(.startup)
                        *(.text)
                        } > ram
                       .data : {
                        *(.data)
                        } > ram
                       .bss : { *(.bss COMMON) }
                       . = ALIGN(8);
                       . = . + 0x1000; /* 4kB of stack memory */
                       stack_top = .;
                      }
                      
                      test.elf:     file format elf64-littleaarch64
                      
                      
                      Disassembly of section .text:
                      
                      0000000040000000 <_Reset>:
                          40000000:   58008485    ldr x5, 40001090 <stack_top>
                          40000004:   d5184105    msr sp_el0, x5
                          40000008:   94000014    bl  40000058 <c_entry>
                          4000000c:   14000000    b   4000000c <_Reset+0xc>
                      
                      0000000040000010 <print_uart0>:
                          40000010:   d10043ff    sub sp, sp, #0x10
                          40000014:   f90007e0    str x0, [sp, #8]
                          40000018:   14000008    b   40000038 <print_uart0+0x28>
                          4000001c:   f94007e0    ldr x0, [sp, #8]
                          40000020:   39400001    ldrb    w1, [x0]
                          40000024:   d2a12000    mov x0, #0x9000000              // #150994944
                          40000028:   b9000001    str w1, [x0]
                          4000002c:   f94007e0    ldr x0, [sp, #8]
                          40000030:   91000400    add x0, x0, #0x1
                          40000034:   f90007e0    str x0, [sp, #8]
                          40000038:   f94007e0    ldr x0, [sp, #8]
                          4000003c:   39400000    ldrb    w0, [x0]
                          40000040:   7100001f    cmp w0, #0x0
                          40000044:   54fffec1    b.ne    4000001c <print_uart0+0xc>  // b.any
                          40000048:   d503201f    nop
                          4000004c:   d503201f    nop
                          40000050:   910043ff    add sp, sp, #0x10
                          40000054:   d65f03c0    ret
                      
                      0000000040000058 <c_entry>:
                          40000058:   a9bf7bfd    stp x29, x30, [sp, #-16]!
                          4000005c:   910003fd    mov x29, sp
                          40000060:   90000000    adrp    x0, 40000000 <_Reset>
                          40000064:   91020000    add x0, x0, #0x80
                          40000068:   97ffffea    bl  40000010 <print_uart0>
                          4000006c:   d503201f    nop
                          40000070:   a8c17bfd    ldp x29, x30, [sp], #16
                          40000074:   d65f03c0    ret
                      
                      Disassembly of section .rodata:
                      
                      0000000040000078 <UART0DR>:
                          40000078:   09000000    .inst   0x09000000 ; undefined
                          4000007c:   00000000    udf #0
                          40000080:   6c6c6548    ldnp    d8, d25, [x10, #-320]
                          40000084:   6f77206f    umlal2  v15.4s, v3.8h, v7.h[3]
                          40000088:   21646c72    .inst   0x21646c72 ; undefined
                          4000008c:   Address 0x000000004000008c is out of bounds.
                      

                      How to get an entry point address in binary image file generated by objcopy?

                      copy iconCopydownload iconDownload
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      
                      MEMORY
                      {
                        RAM : ORIGIN = 0x80000000, LENGTH = 16K
                        FLASH : ORIGIN = 0x20000000, LENGTH = 16M
                      }
                      
                      REGION_ALIAS("REGION_TEXT", FLASH);
                      REGION_ALIAS("REGION_RODATA", FLASH);
                      REGION_ALIAS("REGION_DATA", RAM);
                      REGION_ALIAS("REGION_BSS", RAM);
                      REGION_ALIAS("REGION_HEAP", RAM);
                      REGION_ALIAS("REGION_STACK", RAM);
                      
                      aarch64-none-elf-nm h5-example.elf
                      0000000042000078 t $d
                      0000000042000000 t $x
                      0000000042000080 t $x
                      00000000420001dc t $x
                      00000000420001f4 t $x
                      0000000042000230 B __bss_end__
                      0000000042000230 B __bss_start__
                      0000000042000080 T c_entry
                      000000004200022c D __copy_table_end__
                      0000000042000220 D __copy_table_start__
                      0000000042000230 D __data_end__
                      0000000042000230 D __data_start__
                      0000000042000230 ? __end__
                      0000000042000230 B __etext
                      0000000042000218 T __exidx_end
                      0000000042000218 T __exidx_start
                      0000000042000230 d __fini_array_end
                      0000000042000230 d __fini_array_start
                      0000000046000230 ? __HeapLimit
                      0000000004000000 A __HEAP_SIZE
                      0000000042000230 d __init_array_end
                      0000000042000230 d __init_array_start
                      00000000420001f4 T main
                      0000000042000000 A __RAM_BASE
                      000000000e000000 A __RAM_SIZE
                      0000000042000000 T Reset_Handler
                      0000000000000000 A __ROM_BASE
                      0000000000000000 A __ROM_SIZE
                      000000004c000000 ? __StackLimit
                      0000000004000000 A __STACK_SIZE
                      0000000050000000 ? __StackTop
                      00000000420001dc t system_read_CurrentEL
                      0000000042000230 B __zero_table_end__
                      0000000042000230 B __zero_table_start__
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$'
                      0000000042000000 T Reset_Handler
                      
                      aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1
                      0000000042000000
                      
                      RESET_HANDLER=$(aarch64-none-elf-nm h5-example-02.elf | grep ' Reset_Handler$' | cut -d ' ' -f1)
                      echo ${RESET_HANDLER}
                      
                      0000000042000000
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      cat sample1.bin >> final-image.bin
                      
                      printf "ABCD" > sample1.bin
                      hexdump -C sample1.bin
                      00000000  41 42 43 44                                       |ABCD|
                      00000004
                      
                      echo 0000000042000000 | xxd -r -p > final-image.bin
                      hexdump -C final-image.bin
                      
                      00000000  00 00 00 00 42 00 00 00                           |....B...|
                      00000008
                      
                      cat sample1.bin >> final-image.bin
                      hexdump -C final-image.bin
                      00000000  00 00 00 00 42 00 00 00  41 42 43 44              |....B...ABCD|
                      0000000c
                      
                      #[no_mangle]
                      pub unsafe extern "C" fn Reset() -> ! {
                          let _x = 42;
                      
                          // can't return so we go into an infinite loop here
                          loop {}
                      }
                      
                      // The reset vector, a pointer into the reset handler
                      #[link_section = ".vector_table.reset_vector"]
                      #[no_mangle]
                      pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
                      
                      /* Memory layout of the LM3S6965 microcontroller */
                      /* 1K = 1 KiBi = 1024 bytes */
                      MEMORY
                      {
                        FLASH : ORIGIN = 0x00000000, LENGTH = 256K
                        RAM : ORIGIN = 0x20000000, LENGTH = 64K
                      }
                      
                      /* The entry point is the reset handler */
                      ENTRY(Reset);
                      
                      EXTERN(RESET_VECTOR);
                      
                      SECTIONS
                      {
                        .vector_table ORIGIN(FLASH) :
                        {
                          /* First entry: initial Stack Pointer value */
                          LONG(ORIGIN(RAM) + LENGTH(RAM));
                      
                          /* Second entry: reset vector */
                          KEEP(*(.vector_table.reset_vector));
                        } > FLASH
                      
                        .text :
                        {
                          *(.text .text.*);
                        } > FLASH
                      
                        /DISCARD/ :
                        {
                          *(.ARM.exidx .ARM.exidx.*);
                        }
                      }
                      

                      ARM64 (Cortex-A53) - GNU Assembler - GIC register: unknown or missing system register name

                      copy iconCopydownload iconDownload
                      // write system register  ICC_SRE_EL1 (s3_0_c12_c12_5) with specified value.
                      static inline void system_write_ICC_SRE_EL1(uint64_t val)
                      {
                          asm volatile("msr s3_0_c12_c12_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL1 (s3_0_c12_c12_5).
                      static inline uint64_t system_read_ICC_SRE_EL1(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_0_c12_c12_5" : "=r" (val));
                          return val;
                      }
                      
                      // write system register  ICC_SRE_EL2 (s3_4_c12_c9_5) with specified value.
                      static inline void system_write_ICC_SRE_EL2(uint64_t val)
                      {
                          asm volatile("msr s3_4_c12_c9_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL2 (s3_4_c12_c9_5).
                      static inline uint64_t system_read_ICC_SRE_EL2(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_4_c12_c9_5" : "=r" (val));
                          return val;
                      }
                      
                      // write system register  ICC_SRE_EL3 (s3_6_c12_c12_5) with specified value.
                      static inline void system_write_ICC_SRE_EL3(uint64_t val)
                      {
                          asm volatile("msr s3_6_c12_c12_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL3 (s3_6_c12_c12_5).
                      static inline uint64_t system_read_ICC_SRE_EL3(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_6_c12_c12_5" : "=r" (val));
                          return val;
                      }
                      
                      /* TODO there is one more issues need to be resolved
                         1. handle cpu-implementation-defined system registers.  */
                      const aarch64_sys_reg aarch64_sys_regs [] =
                      {
                        { "spsr_el1",         CPEN_(0,C0,0),  0 }, /* = spsr_svc */
                        { "spsr_el12",    CPEN_ (5, C0, 0), F_ARCHEXT },
                        { "elr_el1",          CPEN_(0,C0,1),  0 },
                        { "elr_el12", CPEN_ (5, C0, 1), F_ARCHEXT },
                        { "sp_el0",           CPEN_(0,C1,0),  0 },
                        { "spsel",            CPEN_(0,C2,0),  0 },
                        { "daif",             CPEN_(3,C2,1),  0 },
                        { "currentel",        CPEN_(0,C2,2),  F_REG_READ }, /* RO */
                        { "pan",      CPEN_(0,C2,3),  F_ARCHEXT },
                        { "uao",      CPEN_ (0, C2, 4), F_ARCHEXT },
                        { "nzcv",             CPEN_(3,C2,0),  0 },
                        { "ssbs",     CPEN_(3,C2,6),  F_ARCHEXT },
                        { "fpcr",             CPEN_(3,C4,0),  0 },
                        { "fpsr",             CPEN_(3,C4,1),  0 },
                        { "dspsr_el0",        CPEN_(3,C5,0),  0 },
                        { "dlr_el0",          CPEN_(3,C5,1),  0 },
                        { "spsr_el2",         CPEN_(4,C0,0),  0 }, /* = spsr_hyp */
                        { "elr_el2",          CPEN_(4,C0,1),  0 },
                        { "sp_el1",           CPEN_(4,C1,0),  0 },
                        { "spsr_irq",         CPEN_(4,C3,0),  0 },
                        { "spsr_abt",         CPEN_(4,C3,1),  0 },
                        { "spsr_und",         CPEN_(4,C3,2),  0 },
                        { "spsr_fiq",         CPEN_(4,C3,3),  0 },
                        { "spsr_el3",         CPEN_(6,C0,0),  0 },
                        { "elr_el3",          CPEN_(6,C0,1),  0 },
                        { "sp_el2",           CPEN_(6,C1,0),  0 },
                        ...
                      
                      // write system register  ICC_SRE_EL1 (s3_0_c12_c12_5) with specified value.
                      static inline void system_write_ICC_SRE_EL1(uint64_t val)
                      {
                          asm volatile("msr s3_0_c12_c12_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL1 (s3_0_c12_c12_5).
                      static inline uint64_t system_read_ICC_SRE_EL1(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_0_c12_c12_5" : "=r" (val));
                          return val;
                      }
                      
                      // write system register  ICC_SRE_EL2 (s3_4_c12_c9_5) with specified value.
                      static inline void system_write_ICC_SRE_EL2(uint64_t val)
                      {
                          asm volatile("msr s3_4_c12_c9_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL2 (s3_4_c12_c9_5).
                      static inline uint64_t system_read_ICC_SRE_EL2(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_4_c12_c9_5" : "=r" (val));
                          return val;
                      }
                      
                      // write system register  ICC_SRE_EL3 (s3_6_c12_c12_5) with specified value.
                      static inline void system_write_ICC_SRE_EL3(uint64_t val)
                      {
                          asm volatile("msr s3_6_c12_c12_5 , %0" : : "r" (val));
                      }
                      
                      // read system register value ICC_SRE_EL3 (s3_6_c12_c12_5).
                      static inline uint64_t system_read_ICC_SRE_EL3(void)
                      {
                          uint64_t val;
                          asm volatile("mrs %0, s3_6_c12_c12_5" : "=r" (val));
                          return val;
                      }
                      
                      /* TODO there is one more issues need to be resolved
                         1. handle cpu-implementation-defined system registers.  */
                      const aarch64_sys_reg aarch64_sys_regs [] =
                      {
                        { "spsr_el1",         CPEN_(0,C0,0),  0 }, /* = spsr_svc */
                        { "spsr_el12",    CPEN_ (5, C0, 0), F_ARCHEXT },
                        { "elr_el1",          CPEN_(0,C0,1),  0 },
                        { "elr_el12", CPEN_ (5, C0, 1), F_ARCHEXT },
                        { "sp_el0",           CPEN_(0,C1,0),  0 },
                        { "spsel",            CPEN_(0,C2,0),  0 },
                        { "daif",             CPEN_(3,C2,1),  0 },
                        { "currentel",        CPEN_(0,C2,2),  F_REG_READ }, /* RO */
                        { "pan",      CPEN_(0,C2,3),  F_ARCHEXT },
                        { "uao",      CPEN_ (0, C2, 4), F_ARCHEXT },
                        { "nzcv",             CPEN_(3,C2,0),  0 },
                        { "ssbs",     CPEN_(3,C2,6),  F_ARCHEXT },
                        { "fpcr",             CPEN_(3,C4,0),  0 },
                        { "fpsr",             CPEN_(3,C4,1),  0 },
                        { "dspsr_el0",        CPEN_(3,C5,0),  0 },
                        { "dlr_el0",          CPEN_(3,C5,1),  0 },
                        { "spsr_el2",         CPEN_(4,C0,0),  0 }, /* = spsr_hyp */
                        { "elr_el2",          CPEN_(4,C0,1),  0 },
                        { "sp_el1",           CPEN_(4,C1,0),  0 },
                        { "spsr_irq",         CPEN_(4,C3,0),  0 },
                        { "spsr_abt",         CPEN_(4,C3,1),  0 },
                        { "spsr_und",         CPEN_(4,C3,2),  0 },
                        { "spsr_fiq",         CPEN_(4,C3,3),  0 },
                        { "spsr_el3",         CPEN_(6,C0,0),  0 },
                        { "elr_el3",          CPEN_(6,C0,1),  0 },
                        { "sp_el2",           CPEN_(6,C1,0),  0 },
                        ...
                      

                      Community Discussions

                      Trending Discussions on one-elf
                      • How do I really disable all rustc optimizations?
                      • Can't find where preempt count in the stack is declared for a percpu variable access. (linux kernel)
                      • Why ARM cores behaving differently with an ELF and binary file
                      • GDB stepping through instructions on a particular core in baremetal development on QEMU
                      • How to run arm64 baremetal hello world program on qemu?
                      • c++: error: unrecognized command-line option ‘-target’
                      • In u-boot compile, linker script's sdram start and length are set by CONFIG_SPL_BSS_START_ADDR and CONFIG_SPL_BSS_MAX_SIZE values, why?
                      • How does `Depends on` and `Selected by` work in Kconfig when they conflict
                      • Why won't me custom kernel launch in QEMU?
                      • Unable to blink Raspberry Pi LED using bare metal Rust
                      Trending Discussions on one-elf

                      QUESTION

                      How do I really disable all rustc optimizations?

                      Asked 2022-Mar-11 at 12:38

                      I'm trying to learn assembly through compiling Rust. I have found a way to compile Rust code to binary machine code and be able to objdump it to view the assembly. However if I write the following:

                      #![no_main]
                      
                      #[link_section = ".text.entry"]
                      #[no_mangle]
                      pub extern "C" fn _start() -> ! {
                          let a: u64 = 4;
                          let b: u64 = 7;
                          let c: u64 = a * b;
                          
                          loop {}
                      }
                      

                      The assembly I get is:

                      0000000000000000 <.data>:
                         0:   1101                    addi    sp,sp,-32
                         2:   4511                    li      a0,4
                         4:   e42a                    sd      a0,8(sp)
                         6:   451d                    li      a0,7
                         8:   e82a                    sd      a0,16(sp)
                         a:   4571                    li      a0,28
                         c:   ec2a                    sd      a0,24(sp)
                         e:   a009                    j       0x10
                        10:   a001                    j       0x10
                      

                      So it looks like rust is collapsing the mul to a constant. I'm using the following compile options:

                      Cargo.toml:

                      [profile.dev]
                      opt-level = 0
                      mir-opt-level = 0
                      

                      Is there a way to stop Rust from optimizing this?

                      The LLVM emitted looks like this:

                      ; Function Attrs: noreturn nounwind
                      define dso_local void @_start() unnamed_addr #0 section ".text.entry" !dbg !22 {
                      start:
                        %c.dbg.spill = alloca i64, align 8
                        %b.dbg.spill = alloca i64, align 8
                        %a.dbg.spill = alloca i64, align 8
                        store i64 4, i64* %a.dbg.spill, align 8, !dbg !36
                        call void @llvm.dbg.declare(metadata i64* %a.dbg.spill, metadata !28, metadata !DIExpression()), !dbg !37
                        store i64 7, i64* %b.dbg.spill, align 8, !dbg !38
                        call void @llvm.dbg.declare(metadata i64* %b.dbg.spill, metadata !31, metadata !DIExpression()), !dbg !39
                        store i64 28, i64* %c.dbg.spill, align 8, !dbg !40
                        call void @llvm.dbg.declare(metadata i64* %c.dbg.spill, metadata !33, metadata !DIExpression()), !dbg !41
                      

                      So it looks like the optimization is before the LLVM pass.

                      $ rustc --version                                                                                                                                           
                      rustc 1.60.0-nightly (c5c610aad 2022-02-14)
                      

                      Command to build:

                      RUSTFLAGS="--emit=llvm-bc" cargo build --target riscv64imac-unknown-none-elf --no-default-features
                      

                      build.rs

                      fn main() {
                          println!("cargo:rerun-if-changed=build.rs");
                          println!("cargo:rustc-link-arg=-Tlink.ld");
                      }
                      

                      link.ld

                      ENTRY(_start)
                      SECTIONS {
                        .text : { *(.text); *(.text.*) }
                      }
                      

                      ANSWER

                      Answered 2022-Mar-11 at 12:38

                      There is one compiler pass before the generation of LLVM-IR, which is the generation of MIR, the Rust intermediate representation. If you emit this for the given code with a command such as this one:

                      cargo rustc -- --emit mir
                      

                      You will see in the .mir file generated that the optimization already took place there.

                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let _1: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          scope 1 {
                              debug a => _1;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _2: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _2;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _3: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _3;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              _1 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              _2 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              _3 = const 28_u64;               // scope 2 at src\main.rs:8:18: 8:23
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb1: {
                              goto -> bb1;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      

                      This is happening because the mir-opt-level option currently only exists as an unstable compiler option. It is not available as a profile property in Cargo. Set it manually on a direct call to the compiler:

                      cargo rustc -- -Z mir-opt-level=0 --emir mir
                      

                      And this optimization will disappear:

                      fn _start() -> ! {
                          let mut _0: !;                       // return place in scope 0 at src\main.rs:5:31: 5:32
                          let mut _1: !;                       // in scope 0 at src\main.rs:5:33: 11:2
                          let _2: u64;                         // in scope 0 at src\main.rs:6:9: 6:10
                          let mut _5: u64;                     // in scope 0 at src\main.rs:8:18: 8:19
                          let mut _6: u64;                     // in scope 0 at src\main.rs:8:22: 8:23
                          let mut _7: (u64, bool);             // in scope 0 at src\main.rs:8:18: 8:23
                          let mut _8: !;                       // in scope 0 at src\main.rs:10:5: 10:12
                          let mut _9: ();                      // in scope 0 at src\main.rs:5:1: 11:2
                          scope 1 {
                              debug a => _2;                   // in scope 1 at src\main.rs:6:9: 6:10
                              let _3: u64;                     // in scope 1 at src\main.rs:7:9: 7:10
                              scope 2 {
                                  debug b => _3;               // in scope 2 at src\main.rs:7:9: 7:10
                                  let _4: u64;                 // in scope 2 at src\main.rs:8:9: 8:10
                                  scope 3 {
                                      debug c => _4;           // in scope 3 at src\main.rs:8:9: 8:10
                                  }
                              }
                          }
                      
                          bb0: {
                              StorageLive(_1);                 // scope 0 at src\main.rs:5:33: 11:2
                              StorageLive(_2);                 // scope 0 at src\main.rs:6:9: 6:10
                              _2 = const 4_u64;                // scope 0 at src\main.rs:6:18: 6:19
                              StorageLive(_3);                 // scope 1 at src\main.rs:7:9: 7:10
                              _3 = const 7_u64;                // scope 1 at src\main.rs:7:18: 7:19
                              StorageLive(_4);                 // scope 2 at src\main.rs:8:9: 8:10
                              StorageLive(_5);                 // scope 2 at src\main.rs:8:18: 8:19
                              _5 = _2;                         // scope 2 at src\main.rs:8:18: 8:19
                              StorageLive(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              _6 = _3;                         // scope 2 at src\main.rs:8:22: 8:23
                              _7 = CheckedMul(_5, _6);         // scope 2 at src\main.rs:8:18: 8:23
                              assert(!move (_7.1: bool), "attempt to compute `{} * {}`, which would overflow", move _5, move _6) -> bb1; // scope 2 at src\main.rs:8:18: 8:23
                          }
                      
                          bb1: {
                              _4 = move (_7.0: u64);           // scope 2 at src\main.rs:8:18: 8:23
                              StorageDead(_6);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageDead(_5);                 // scope 2 at src\main.rs:8:22: 8:23
                              StorageLive(_8);                 // scope 3 at src\main.rs:10:5: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      
                          bb2: {
                              _9 = const ();                   // scope 3 at src\main.rs:10:10: 10:12
                              goto -> bb2;                     // scope 3 at src\main.rs:10:5: 10:12
                          }
                      }
                      

                      And this is probably as far as you can go without touching LLVM directly. Some optimisations in specific parts of the code can also be prevented through constructs such as black_box.

                      See also:

                      Source https://stackoverflow.com/questions/71437329

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install one-elf

                      You can download it from GitHub.
                      You can use one-elf like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the one-elf component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Share this Page

                      share link
                      Consider Popular Java Libraries
                      Try Top Libraries by odnoklassniki
                      Compare Java Libraries with Highest Support
                      Compare Java Libraries with Highest Quality
                      Compare Java Libraries with Highest Security
                      Compare Java Libraries with Permissive License
                      Compare Java Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.