elf: Include <sysdep.h> in elf/dl-debug-symbols.S

Message ID 87h7ef4hu2.fsf@oldenburg.str.redhat.com
State Committed
Commit 7e84ac3a3ac9e7c4dc10de2ce65db971b9650e4d
Headers
Series elf: Include <sysdep.h> in elf/dl-debug-symbols.S |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Sept. 20, 2021, 11:17 a.m. UTC
  This is necessary to generate assembler marker sections on some
targets.

---
Built with build-many-glibcs.py.

 elf/dl-debug-symbols.S | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Szabolcs Nagy Sept. 20, 2021, 1:45 p.m. UTC | #1
The 09/20/2021 13:17, Florian Weimer via Libc-alpha wrote:
> This is necessary to generate assembler marker sections on some
> targets.

thanks.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

> 
> ---
> Built with build-many-glibcs.py.
> 
>  elf/dl-debug-symbols.S | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/elf/dl-debug-symbols.S b/elf/dl-debug-symbols.S
> index b7e9f5d947..28456ab1f2 100644
> --- a/elf/dl-debug-symbols.S
> +++ b/elf/dl-debug-symbols.S
> @@ -18,6 +18,10 @@
>     <https://www.gnu.org/licenses/>.  */
>  
>  #include <rtld-sizes.h>
> +#include <sysdep.h>
> +
> +/* Some targets define a macro to denote the zero register.  */
> +#undef zero
>  
>  /* Define 2 symbols, _r_debug_extended and _r_debug, which is an alias
>     of _r_debug_extended, but with the size of struct r_debug.  */
>
  
H.J. Lu Sept. 20, 2021, 1:53 p.m. UTC | #2
On Mon, Sep 20, 2021 at 4:17 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> This is necessary to generate assembler marker sections on some
> targets.
>
> ---
> Built with build-many-glibcs.py.
>
>  elf/dl-debug-symbols.S | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/elf/dl-debug-symbols.S b/elf/dl-debug-symbols.S
> index b7e9f5d947..28456ab1f2 100644
> --- a/elf/dl-debug-symbols.S
> +++ b/elf/dl-debug-symbols.S
> @@ -18,6 +18,10 @@
>     <https://www.gnu.org/licenses/>.  */
>
>  #include <rtld-sizes.h>
> +#include <sysdep.h>
> +
> +/* Some targets define a macro to denote the zero register.  */
> +#undef zero
>
>  /* Define 2 symbols, _r_debug_extended and _r_debug, which is an alias
>     of _r_debug_extended, but with the size of struct r_debug.  */
>

FWIW,  x86 uses

# Compile assembly codes with <cet.h> when CET is enabled.
asm-CPPFLAGS += -fcf-protection -include cet.h
  

Patch

diff --git a/elf/dl-debug-symbols.S b/elf/dl-debug-symbols.S
index b7e9f5d947..28456ab1f2 100644
--- a/elf/dl-debug-symbols.S
+++ b/elf/dl-debug-symbols.S
@@ -18,6 +18,10 @@ 
    <https://www.gnu.org/licenses/>.  */
 
 #include <rtld-sizes.h>
+#include <sysdep.h>
+
+/* Some targets define a macro to denote the zero register.  */
+#undef zero
 
 /* Define 2 symbols, _r_debug_extended and _r_debug, which is an alias
    of _r_debug_extended, but with the size of struct r_debug.  */