12.07.2015 Views

RealView - ARM Information Center

RealView - ARM Information Center

RealView - ARM Information Center

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

访 问 映 像 符 号4.5 使 用 $Super$$ 和 $Sub$$ 覆 盖 符 号 定 义在 某 些 情 况 下 , 无 法 修 改 现 有 符 号 , 例 如 , 由 于 符 号 位 于 外 部 库 或 ROM 代 码中 。可 以 使 用 $Super$$ 和 $Sub$$ 模 式 来 修 补 现 有 符 号 。例 如 , 要 修 补 函 数 foo() 的 定 义 , 请 按 如 下 方 式 使 用 $Super$$foo() 和 $Sub$$foo():$Super$$foo 标 识 未 修 补 的 原 始 函 数 foo()。 使 用 它 可 以 直 接 调 用 原 函 数 。$Sub$$foo标 识 调 用 的 新 函 数 , 而 不 是 原 始 函 数 foo()。 可 以 使 用 此 模 式 在 原始 函 数 之 前 或 之 后 添 加 处 理 。示 例 4-6 说 明 了 修 改 遗 留 函 数 foo() 而 导 致 调 用 ExtraFunc() 和 foo()。 有 关 详 细信 息 , 请 参 阅 install_directory\Documentation\Specifications\... 中 的 《<strong>ARM</strong>ELF 规 范 》 和 aaelf.pdf。示 例 4-6 使 用 $Super$$ 和 $Sub$$extern void ExtraFunc(void);extern void $Super$$foo(void):/* this function is called instead of the original foo() */void $Sub$$foo(void){ExtraFunc(); /* does some extra setup work */$Super$$foo(); /* calls the original foo() function */}<strong>ARM</strong> DUI 0349AC 版 权 所 有 © 2007 <strong>ARM</strong> 公 司 。 保 留 所 有 权 利 。 4-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!