PandABlocks / PandABlocks-server

TCP server exposing an ASCII interface to functional blocks
Apache License 2.0
2 stars 3 forks source link

ARM Debian 9 Local gcc compile #2

Closed kimanha closed 5 years ago

kimanha commented 5 years ago

Hello,

I am trying to local compile based on ARM Debian 9 and I found below error. Any way to compile source ?

root@microjed-sG:/home/kha/PandA/PandABlocks-server# make server
mkdir -p /home/kha/PandA/PandABlocks-server/build/server
make -C /home/kha/PandA/PandABlocks-server/build/server -f /home/kha/PandA/PandABlocks-server/server/Makefile VPATH=/home/kha/PandA/PandABlocks-server/server TOP=/home/kha/PandA/PandABlocks-server PYTHON=python2 CC=gcc
make[1]: Entering directory '/home/kha/PandA/PandABlocks-server/build/server'
/home/kha/PandA/PandABlocks-server/server/Makefile:160: server.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: version.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: locking.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: persistence.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: error.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: socket_server.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: config_server.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: data_server.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: buffer.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: buffered_file.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: parse.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: utf8_check.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: parse_lut.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: hashtable.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: database.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: config_command.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: system_command.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: fields.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: types.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: enums.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: attributes.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: pos_mux.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: ext_out.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: bit_out.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: pos_out.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: output.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: prepare.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: capture.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: time.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: table.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: register.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: base64.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: metadata.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: mac_address.d: No such file or directory
/home/kha/PandA/PandABlocks-server/server/Makefile:160: extension.d: No such file or directory
set -o pipefail && gcc -M -D_GNU_SOURCE -I/home/kha/PandA/PandABlocks-server/driver -I. -std=gnu99 -O3 -g -Werror -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wcast-qual -Woverflow -Wconversion -fstrict-overflow -Wsign-compare -Wstrict-overflow=5 -Wno-switch-enum -Wno-variadic-macros -Wno-padded -Wno-format-nonliteral -Wno-vla -Wno-c++-compat -Wno-pointer-arith -Wno-unused-parameter -Wno-missing-field-initializers /home/kha/PandA/PandABlocks-server/server/extension.c | \
            sed '1s/:/ extension.d:/' >extension.d
set -o pipefail && gcc -M -D_GNU_SOURCE -I/home/kha/PandA/PandABlocks-server/driver -I. -std=gnu99 -O3 -g -Werror -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wcast-qual -Woverflow -Wconversion -fstrict-overflow -Wsign-compare -Wstrict-overflow=5 -Wno-switch-enum -Wno-variadic-macros -Wno-padded -Wno-format-nonliteral -Wno-vla -Wno-c++-compat -Wno-pointer-arith -Wno-unused-parameter -Wno-missing-field-initializers /home/kha/PandA/PandABlocks-server/server/mac_address.c | \
            sed '1s/:/ mac_address.d:/' >mac_address.d

:
:+1: 

:
egister.o base64.o metadata.o mac_address.o extension.o hw_hardware.o | grep ' [CD] '
00000030 D entity_commands
00000104 D system_commands
00000000 D enum_type_methods
00000000 D pos_mux_class_methods
0000004c D ext_out_class_methods
00000048 D bit_mux_class_methods
00000000 D bit_out_class_methods
00000024 D pos_out_class_methods
00000028 D time_class_methods
00000008 D time_type_methods
0000000c D table_class_methods
00000090 D param_class_methods
00000048 D read_class_methods
00000000 D write_class_methods
/home/kha/PandA/PandABlocks-server/server/Makefile:150: recipe for target 'server' failed
make[1]: *** [server] Error 1
make[1]: Leaving directory '/home/kha/PandA/PandABlocks-server/build/server'
Makefile:93: recipe for target '/home/kha/PandA/PandABlocks-server/build/server/server' failed
make: *** [/home/kha/PandA/PandABlocks-server/build/server/server] Error 2

Thanks, Kiman NSLS-II Controls

Araneidae commented 5 years ago

Same comments as for issue #3: you've somehow unset CROSS_COMPILE, and please don't build as root. Building PandA doesn't require root at any stage, and it must be built with the Xilinx cross-compile toolchain.

kimanha commented 5 years ago

Okay, instead of ARM Debian local compile, I move to cross-compile from Linux Host computer. make server is a success. Thank you.

Araneidae commented 5 years ago

It looks like you're retargeting PandA to a different hardware and software platform? Is this right?

If so I guess you're going to encounter some compiler issues if you change compiler. The particular error you have encountered here comes from line 150 (and line 154) of server/Makefile, and it looks as if your native compiler is treating const initialised data differently from ours. Both our native (gcc 4.8.5) and cross (4.9.1) compilers place shared const data in what nm refers to as "a read only data section"; on the other hand, it looks as if your microjed compiler places this data in "the initialized data section".

I have tried more recent versions of gcc and have not seen this problem before. You can work around the problem simply by deleting the nm lines, but I would like to know why this is happening.

Araneidae commented 5 years ago

Can you let me know what gcc --version reports on your ARM Debian? Have you made any changes to CFLAGS?

kimanha commented 5 years ago

kha@microjed-sG:~/PandA/PandABlocks-server$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

CROSS_COMPILE = arm-xilinx-linux-gnueabi-

I changed Makefile below:

BINUTILS_DIR =

KERNEL_DIR = $(error Define KERNEL_DIR in CONFIG file)

KERNEL_DIR = /lib/modules/4.19.0-xilinx-v2019.1/build

PANDA_ROOTFS = /home/kha/PandA/PandABlocks-rootfs

Araneidae commented 5 years ago

Hmm. Can you show me the result of running this, please:

echo 'const int x = 1;' | gcc -x c -c -o test.o -; nm test.o

I get

0000000000000000 R x

but I'm guessing you'll get 00000000 D x instead, and its the D that's puzzling me.

Your compiler looks pretty new; I'll compare with Fedora when I have a chance.

kimanha commented 5 years ago

my test platform is before move to picozed platform( I do not have picozed board).

Avnet microzed 7020 Kernel 4.19 Debian 9.0 rootfs

How can I get an FPGA design_xxx.hdf file? I tried to build FPGA project, but unfortunately, I can not build a project because of the environment is different. If you give me the latest hdf and device tree file then I can create petalinux kernel for the picozed SoC board.

Do you have Vivado FPGA project with a full module (Actually I send email to Uzun but no responded)?

Thanks,

kimanha commented 5 years ago

@microjed-sG:~/PandA/PandABlocks-server$ echo 'const int x = 1;' | gcc -x c -c -o test.o -; nm test.o 00000000 R x

Araneidae commented 5 years ago

Interesting. I wonder why you got D for the declarations in the server. If you could experiment on one of the source files I'd be grateful: maybe it's a compiler option, maybe it's something in the source. All the names (focus on just one, say entity_commands which you can find in server/config_command.c) are declared as const structures with a separate extern declaration, and they should all go into R blocks.

For FPGA build questions, I suggest you put an issue on PandABlocks-FPGA.

kimanha commented 5 years ago

are declared as const structures with a separate extern declaration, and they should all go into R blocks.

Can you please give some example how change code for test?

Araneidae commented 5 years ago

Sure. It's a bit of a drawn out process, but here goes.

First of all, let's get the build command and verify that we're chasing the right problem. Go back to your ARM Debian system and run make server, check that we get the error again. To find the precise build command, run touch server/config_command.c, run make server, and look for a very long line starting gcc and ending /path/to/server/config_command.c; on my system I get:

arm-xilinx-linux-gnueabi-gcc -std=gnu99 -O3 -g -Werror -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wcast-qual -Woverflow -Wconversion -fstrict-overflow -Wsign-compare -Wstrict-overflow=5 -Wno-switch-enum -Wno-variadic-macros -Wno-padded -Wno-format-nonliteral -Wno-vla -Wno-c++-compat -Wno-pointer-arith -Wno-unused-parameter -Wno-missing-field-initializers -D_GNU_SOURCE -I/home/mga83/targetOS/zebra2-server/driver -I.  -c -o config_command.o /home/mga83/targetOS/zebra2-server/server/config_command.c

Please paste a copy of your version of this command here! You can now run this command anywhere to rebuild config_command.o, and check for the problem by running

nm config_command.o | grep entity_commands

If this returns a line with R the problem has gone away, and I'm out of ideas, if there is a D we are in business.

I'd then start by pruning all the -W options from the gcc command line, and you can safely prune the -I options; my command line reduces to:

arm-xilinx-linux-gnueabi-gcc -std=gnu99 -O3 -g  -D_GNU_SOURCE  -c -o config_command.o /home/mga83/targetOS/zebra2-server/server/config_command.c

Run nm and check for D or R again. Next you can try removing the -O3, -g, -D_GNU_SOURCE options, rerun, check again. If you're down to something as simple as gcc -std=gnu99 -c -o config_command.o config_command.c and still generating D then it's something to do with the source.

Take a copy of config_command.c (and make sure your new simplified gcc command now points to it). First of all I'd delete lines 341-343 (the .get, .put, .put_table assignments in the entity_commands definition), rebuild, see if we have D or R. If still D then you can delete everything in config_command.c from the last #include up to the definition of entity_commands (lines 18-339) and try again.

If we're still getting D ... well, let's see how you get on.

Araneidae commented 5 years ago

P.S. The nm test can safely be deleted from your build, it's just me trying to make sure I don't accidentally create any writeable global variables. However, I'd rather get to the bottom of this if you have the patience...

kimanha commented 5 years ago
gcc -M -D_GNU_SOURCE -I/home/kha/PandA/PandABlocks-server/driver -I. -std=gnu99 -O3 -g -Werror -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wcast-qual -Woverflow -Wconversion -fstrict-overflow -Wsign-compare -Wstrict-overflow=5 -Wno-switch-enum -Wno-variadic-macros -Wno-padded -Wno-format-nonliteral -Wno-vla -Wno-c++-compat -Wno-pointer-arith -Wno-unused-parameter -Wno-missing-field-initializers /home/kha/PandA/PandABlocks-server/server/config_command.c
~/PandA/PandABlocks-server/server$ gcc -std=gnu99 -c -o config_command.o config_command.c
kha@microjed-sG:~/PandA/PandABlocks-server/server$ nm config_command.o | grep entity_commands
00000030 D entity_commands

First of all I'd delete lines 341-343 (the .get, .put, .put_table assignments in the entity_commands definition), rebuild

nm config_command.o | grep entity_commands
00000080 R entity_commands
Araneidae commented 5 years ago

Thank you, that is helpful and interesting, and you've verified that the issue is in the content of the C file.

I'm going to guess that the difference between the two cases is the presence of links to functions in the C code. Can you try again with the following minimal case. Create a file test.c with the following two lines:

static int f(int x) { return x; }
const struct { int (*f)(int); } s = { .f = f };

Compile this with the following command:

gcc -c -o -O2 test.o test.c

and look at the result with nm:

$ nm test.o
00000000 t $a
         U __aeabi_unwind_cpp_pr0
00000000 r $d
00000000 r $d
00000000 t f
00000000 R s

(That's what I see with our Xilinx compiler, I see a slightly simpler output with native gcc.)

If you see 00000000 D s then we've verified the problem, and I'll have to ask elsewhere about this strange compiler behaviour. If you do see this, also can you run:

gcc -c -S -O2 test.c

and paste the contents of test.s here.

kimanha commented 5 years ago
kha@microjed-sG:~/test$ gcc -c -o -O2 test.o test.c
gcc: error: test.o: No such file or directory

kha@microjed-sG:~/test$ gcc -c -O2 -o test.o test.c
kha@microjed-sG:~/test$ nm test.o
00000000 t f
00000000 D s

kha@microjed-sG:~/test$ gcc -c -S -O2 test.c

kha@microjed-sG:~/test$ cat test.s
        .arch armv7-a
        .eabi_attribute 28, 1
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 34, 1
        .eabi_attribute 18, 4
        .file   "test.c"
        .text
        .align  1
        .p2align 2,,3
        .syntax unified
        .thumb
        .thumb_func
        .fpu vfpv3-d16
        .type   f, %function
f:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        bx      lr
        .size   f, .-f
        .global s
        .section        .data.rel.ro.local,"aw",%progbits
        .align  2
        .type   s, %object
        .size   s, 4
s:
        .word   f
        .ident  "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
        .section        .note.GNU-stack,"",%progbits
Araneidae commented 5 years ago

Sorry, I messed up the -O2 flag! I guess I need one more piece to complete the story. So here we see variable s going into section .data.rel.ro.local, presumably because it's got a link (to f) that will need relocation. Can you extend test.c with one more line, please:

static int f(int x) { return x; }
const struct { int (*f)(int); } s = { .f = f };
const int t = 0;

and try again: it's probably enough to just tell me what section t goes into (I'm presuming t will be a R symbol).

I doubt I'll get much further with this, you'll have to work around this (just remove the nm line from the build) if you want native compilation, but I think you've given me all the information I need if only I can figure out who to ask about this...

Araneidae commented 5 years ago

So, it seems that the .data.rel.ro.local section is a linker trick: gcc SO question linking to Linker relro. Alas, it looks as if nm reports this section as D not R.

I'm going to say we're stuck with this behaviour with your complier and close this out. Still, I would be grateful if you do add the section info for t in my last comment.

kimanha commented 5 years ago
kha@microjed-sG:~/PandA/PandABlocks-server$ nm test1.o
00000000 t f
00000000 D s
00000000 R t
kha@microjed-sG:~/PandA/PandABlocks-server$ cat test1.s
        .arch armv7-a
        .eabi_attribute 28, 1
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 34, 1
        .eabi_attribute 18, 4
        .file   "test1.c"
        .text
        .align  1
        .p2align 2,,3
        .syntax unified
        .thumb
        .thumb_func
        .fpu vfpv3-d16
        .type   f, %function
f:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        bx      lr
        .size   f, .-f
        .global t
        .global s
        .section        .rodata
        .align  2
        .type   t, %object
        .size   t, 4
t:
        .space  4
        .section        .data.rel.ro.local,"aw",%progbits
        .align  2
        .type   s, %object
        .size   s, 4
s:
        .word   f
        .ident  "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
        .section        .note.GNU-stack,"",%progbits
kimanha commented 5 years ago

you'll have to work around this (just remove the nm line from the build) if you want native compilation

without nm it compiled.

Araneidae commented 5 years ago

Ta. That is, alas, exactly as expected. Guess I'll have to ask on a suitable gcc forum.

Hmm. I'm seeing the same behaviour on Ubuntu (gcc version 7.4.0); am pretty sure I tested on Fedora which is gcc 8 something, and RHEL7 (gcc 4.8.5) without the problem.

Thank you for your help. For now I'm inclined to put this down to a gcc version issue, but I'll leave this issue closed for the time being.

kimanha commented 5 years ago

Thank so much for your support.

kimanha commented 5 years ago

I have Debian 7 and old kernel version. Can you please look at any difference?

zbpm:~/test# uname -r
3.17.0-xilinx

zbpm:~/test# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14)

zbpm:~/test# cat test1.c
static int f(int x) { return x; }
const struct { int (*f)(int); } s = { .f = f };
const int t = 0;

zbpm:~/test# gcc -c -O2 -o test1.o test1.c
zbpm:~/test# ls
test1.c  test1.o
zbpm:~/test# nm test1.o
00000000 t f
00000004 R s
00000000 R t

zbpm:~/test# cat test1.s
        .syntax unified
        .arch armv7-a
        .eabi_attribute 27, 3
        .eabi_attribute 28, 1
        .fpu vfpv3-d16
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 18, 4
        .thumb
        .file   "test1.c"
        .text
        .align  2
        .thumb
        .thumb_func
        .type   f, %function
f:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        bx      lr
        .size   f, .-f
        .global t
        .global s
        .section        .rodata
        .align  2
        .type   t, %object
        .size   t, 4
t:
        .space  4
        .type   s, %object
        .size   s, 4
s:
        .word   f
        .ident  "GCC: (Debian 4.6.3-14) 4.6.3"
        .section        .note.GNU-stack,"",%progbits
Araneidae commented 5 years ago

I'll try and draw up a table of what we've learnt:

GCC Dist nm section
4.6.3 Debian 7 R .rodata
4.8.5 RHEL7 R .rodata
6.3.0 Debian 9 D .data.rel.ro.local
7.4.0 Ubuntu 18.04 D .data.rel.ro.local
9.1.1 Fedora 30 R .rodata

So the nm problem is directly correlated with using .data.rel.ro.local, which seems to be a Debian issue.

By the way, we can simplify the test code to the following two lines:

const int t = 0;
const int *const u = &t;

It's the presence of a relocation that's making the difference.

kimanha commented 5 years ago

Debian 7:

nm test2.o
00000004 R t
00000000 R u

zbpm:~/test# cat test2.s
        .syntax unified
        .arch armv7-a
        .eabi_attribute 27, 3
        .eabi_attribute 28, 1
        .fpu vfpv3-d16
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 18, 4
        .thumb
        .file   "test2.c"
        .global u
        .global t
        .section        .rodata
        .align  2
        .type   u, %object
        .size   u, 4
u:
        .word   t
        .type   t, %object
        .size   t, 4
t:
        .space  4
        .ident  "GCC: (Debian 4.6.3-14) 4.6.3"
        .section        .note.GNU-stack,"",%progbits

Debian 9:

kha@microjed-sG:~/test$ nm test2.o
00000000 R t
00000000 D u

drvHello  test.c  test.o  test.s  test2.c  test2.s
kha@microjed-sG:~/test$ cat test2.s
        .arch armv7-a
        .eabi_attribute 28, 1
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 34, 1
        .eabi_attribute 18, 4
        .file   "test2.c"
        .global u
        .global t
        .section        .rodata
        .align  2
        .type   t, %object
        .size   t, 4
t:
        .space  4
        .section        .data.rel.ro.local,"aw",%progbits
        .align  2
        .type   u, %object
        .size   u, 4
u:
        .word   t
        .ident  "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
        .section        .note.GNU-stack,"",%progbits