Comments (7)
I loaded chipbug_bad into a debugger and both symbols are present in chip memory.
What happens is: The linker merges the chip_bss section into the data_bss section, which IMHO is legal.
Disassembly of section .data:
00000000 <_test_data>:
0: 1234 5678
00000004 <_test_bss>:
4: 0000 0000
from amiga-gcc.
Hmm. I see both symbols merged into BSS, rather than data, with chipbug_bad.
hunktool -A info chipbug_bad
chipbug_bad (0.0001s) TYPE_LOADSEG
header (segments: first=0, last=1, table size=2)
#000 CODE size 00000004 alloc size 00000004 file header @0000001c data @00000024
symbol #4
00000004 __etext
00000004 ___datadata_relocs
00000000 __stext
00000000 _main
_main:
00000000 7000 moveq #0,d0
00000002 4e75 rts
#001 BSS size 00000008 alloc size 00000008 file header @00000080
symbol #2
00000000 _test_bss
00000004 _test_data
(Objdump doesn't show the BSS segment so I used hunktool here instead.)
from amiga-gcc.
my output is from m68k-amigaos-objdump -S chipbug_bad
my own tool reports:
> hunkdump.exe chipbug_bad
reading chipbug_bad
hunk 000003f3, HUNK_HEADER, 0
4 sections, 0 - 3
sizes: 5864, 328, 96, 8(c)
hunk 000003e9, HUNK_CODE, 5864
hunk 000003ec, HUNK_RELOC32, 344
hunk 000003f0, HUNK_SYMBOL, 12
HUNK_END
hunk 000003ea, HUNK_DATA, 328
hunk 000003ec, HUNK_RELOC32, 40
hunk 000003f0, HUNK_SYMBOL, 16
HUNK_END
hunk 000003eb, HUNK_BSS, 96
hunk 000003f0, HUNK_SYMBOL, 12
HUNK_END
hunk 000003ea, HUNK_DATA, 8
hunk 000003f0, HUNK_SYMBOL, 12
HUNK_END
So the chip data has a size of 8 bytes has the chip memory attribute.
To verify I loaded it into an Amiga debugger and both chip memory addresses are really in the chip memory.
EDIT:
version info:
GNU ld version 2.14b 20180609-214714
gcc version 6.4.1b 20180616-173350 (GCC)
from amiga-gcc.
btw you can use objdump to display the sections too:
> m68k-amigaos-objdump.exe -h chipbug_bad
chipbug_bad: file format amiga
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000016e8 00000000 00000000 0000002c 2**2
CONTENTS, ALLOC, LOAD, RELOC, CODE
1 .data 00000148 00000000 00000000 00002084 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
2 .bss 00000060 00000000 00000000 000022c8 2**2
ALLOC
3 .data 00000008 00000000 00000000 000023d4 2**2
CONTENTS, ALLOC, LOAD, DATA
from amiga-gcc.
Looks like my amiga-gcc update attempt failed. It seems I still have a May 4th build (not too old but maybe something changed?) and it generates this:
chipbug_bad: file format amiga
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000004 00000000 00000000 00000024 2**2
CONTENTS, ALLOC, LOAD, CODE
1 .bss 00000008 00000000 00000000 00000088 2**2
ALLOC```
I tried doing a 'make clean' and 'make' but end up with:
m68k-amigaos-gcc -Os -DCHIP_BSS -o chipbug_bad chipbug.c
/home/jay/env/m68k-amigaos/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: cannot open crt0.o: No such file or directory
from amiga-gcc.
git pull
make update -j
make all
should do it - if the result is not ok go the long way:
git pull
make clean clean-prefix update -j
make all
from amiga-gcc.
Yep, that worked! It seems that bug was indeed fixed in the last month.
I think using -j broke my update, because I tried it again after a clean and it finished very quickly. I then cleaned again and started without -j and it spent a lot longer rebuilding everything. I'll be sure to clean and build single threaded in future.
Thanks for the help.
from amiga-gcc.
Related Issues (20)
- [MSYS2 on Windows, building w/ gcc amiga13.1] configure libdebug...failed, fatal error: cannot find 'ld' HOT 3
- Building GCC and binutils gdb on MacOS started to fail HOT 1
- Build failures - changing branch to amiga13v2 isn't easy HOT 22
- Build failing on Arch Linux HOT 6
- Compiling with any optimization other than -O0 leads to various miscompilations HOT 2
- Problems compiling on MacOS HOT 1
- MacoOS sdk creation protos include issue HOT 2
- 6.5.0b/libstdc++.a(iostream-inst.o): duplicate section - problem with std::setfill HOT 1
- _custom , ciaa and ciaab should be marked as "far" HOT 2
- gcc fails to compile on macOS Sonoma (14.1) HOT 6
- NT_INTERRUPT issues HOT 1
- I managed to build bebbo amiga gcc cross-compiler on MSYS2 to a point where linker HOT 1
- Add supported processors to README HOT 4
- Cannot build on MacOS due to CC_FOR_BUILD error HOT 1
- Broken Makefile for 13.1 branch? HOT 1
- Arch Linux "make update" Problem HOT 3
- Is it possible to compile Amiga Shared Libraries with this wonderfull compiler ? HOT 7
- Program will exit because of unwanted automatic LoadLibrary() with optional lib HOT 2
- aminet links and amitools on Debian and Ubuntu HOT 7
- gcc build fails on Fedora 39 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amiga-gcc.